Skip to content

Commit 812bc83

Browse files
committed
Update testing doc
1 parent a028073 commit 812bc83

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docs/testing.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Gotchas
44

55
### Triggering validation on `change`/`blur` events
6-
When testing `on*` strategies (e.g. `onFirstChange`, `onFirstBlur`) set next props **before** simulate event, that triggers validation. Otherwise obsolete props will be passed to validator:
6+
When testing sync strategies (e.g. `onFirstChange`, `onFirstBlur`) set next props **before** simulate event, that triggers validation. Otherwise obsolete props will be passed to validator:
77

88
```js
99
/* strategy: 'onFirstChange' */
@@ -12,5 +12,3 @@ Form.setProps({ data: { email: '[email protected]' } }); // <= update data first
1212
Form.find('.input').simulate('change'); // <= trigger event -> validation
1313
expect(/* ... */)).toBe(/* ... */);
1414
```
15-
16-
Since `instant`-type strategies validate all fields on props update (in lifecycle hooks), just setting next props should be fine.

0 commit comments

Comments
 (0)