Update Simulate docs to reflect reality
cf. #1532, #1445.
Ben Alpert committed
May 14, 2014 at 21:39 UTC
c913c95908fbc3eb5ee61e2832f57cb5d4d03d99
1 file changed
+6
-5
docs/docs/09.4-test-utils.md
+6
-5
@@ -12,17 +12,18 @@ next: clone-with-props.html
12
### Simulate
13
14
```javascript
15
-Simulate.{eventName}({ReactComponent|DOMElement} element, object eventData)
15
+Simulate.{eventName}(DOMElement element, object eventData)
16
```
17
18
-Simulate an event dispatch on a React component instance or browser DOM node with optional `eventData` event data. **This is possibly the single most useful utility in `ReactTestUtils`.**
18
+Simulate an event dispatch on a DOM node with optional `eventData` event data. **This is possibly the single most useful utility in `ReactTestUtils`.**
19
20
Example usage:
21
22
```javascript
23
-React.addons.TestUtils.Simulate.click(myComponent);
24
-React.addons.TestUtils.Simulate.change(myComponent);
25
-React.addons.TestUtils.Simulate.keyDown(myComponent, {key: "Enter"});
23
+var node = this.refs.input.getDOMNode();
24
+React.addons.TestUtils.Simulate.click(node);
25
+React.addons.TestUtils.Simulate.change(node);
26
+React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"});
27
```
28
29
`Simulate` has a method for every event that React understands.