Skip to content

Commit 865e5b3

Browse files
committed
Fixed typos in the testing examples.
1 parent fad0ddd commit 865e5b3

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

packages/examples/src/tests/.eslintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"env": {
3+
"jasmine": true
4+
},
5+
"rules": {
6+
"react/prop-types": "off"
7+
}
8+
}

packages/react-renderer-demo/src/app/pages/testing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ import CodeExample from '../src/components/code-example';
99

1010
Always make sure that your **custom components** and their features are tested to avoid bugs and runtime crashes.
1111

12-
In these examples we will use [Jest](https://jestjs.io/) and [Enzyme](https://enzymejs.github.io/enzyme/docs/api/) but the same rules apply to any other testing libraries.
12+
In these examples, we will use [Jest](https://jestjs.io/) and [Enzyme](https://enzymejs.github.io/enzyme/docs/api/) but the same rules apply to any other testing libraries.
1313

1414
## Testing the renderer
1515

16-
If you want to test your whole form, the easiest way is just to render it as you would normaly. Be carefoul that you will have to mock all your async validations and submitions. Data driven forms have a great test coverage so its not necessary to test core features.
16+
If you want to test your whole form, the easiest way is just to render it as you would normally. Be careful that you will have to mock all your async validations and submissions. Data driven forms have great test coverage so its not necessary to test core features.
1717

18-
Bellow is an example of a form with a async validation and a conditional field. All features in the data driven forms packages are tested by the library. It should not be required to tests them most of the time.
18+
Below is an example of a form with an async validation and a conditional field. All features in the data driven forms packages are tested by the library. It should not be required to tests them most of the time.
1919

2020
<CodeExample source="tests/form-renderer.test" />
2121

2222
## Testing custom components
2323

24-
Components that are using `useFieldApi` or `useFormApi` must be children of contexts. Therefore they must be wrapped inside these contexts when testing. The simplest way to test them, is just rendering them with the FormRenderer, but there may be cases when that is not possible. We will show you both options.
24+
Components that are using `useFieldApi` or `useFormApi` must be children of contexts. Therefore they must be wrapped inside these contexts when testing. The simplest way to test them is just rendering them with the FormRenderer, but there may be cases when you might now want to do that. We will show you both options.
2525

2626
### With renderer
2727

28-
Set up your renderer to make it easier to test the component specific features. Use initial values to trigger falsey validation results to avoid unnecessary changes simlation.
28+
Set up your renderer to make it easier to test the component-specific features. Use initial values to trigger falsey validation results to avoid unnecessary changes simulation.
2929

3030
<CodeExample source="tests/custom-component-with-renderer.test" />
3131

3232
### Outside renderer
3333

34-
Rendering components outside of the renderer will require some additional set up which is not traditionally used when using form renderer and require some additional knowledge of the library. Most notably, you need to wrap the component inside the `Form` component and `RendererContext`. No functinality provided by the renderer like validations or conditions will be provided so it must be configured.
34+
Rendering components outside of the renderer will require some additional set up which is not traditionally used when using form renderer and require some additional knowledge of the library. Most notably, you need to wrap the component inside the `Form` component and `RendererContext`. No functionality provided by the renderer like validations or conditions will be provided so it must be configured.
3535

3636
<CodeExample source="tests/custom-component-outside-renderer.test" />
3737

0 commit comments

Comments
 (0)