Update Simulate docs to reflect reality

cf. #1532, #1445.
This commit is contained in:
Ben Alpert
2014-05-14 21:39:00 -07:00
parent b66202eb98
commit c913c95908
+6 -5
View File
@@ -12,17 +12,18 @@ next: clone-with-props.html
### Simulate
```javascript
Simulate.{eventName}({ReactComponent|DOMElement} element, object eventData)
Simulate.{eventName}(DOMElement element, object eventData)
```
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`.**
Simulate an event dispatch on a DOM node with optional `eventData` event data. **This is possibly the single most useful utility in `ReactTestUtils`.**
Example usage:
```javascript
React.addons.TestUtils.Simulate.click(myComponent);
React.addons.TestUtils.Simulate.change(myComponent);
React.addons.TestUtils.Simulate.keyDown(myComponent, {key: "Enter"});
var node = this.refs.input.getDOMNode();
React.addons.TestUtils.Simulate.click(node);
React.addons.TestUtils.Simulate.change(node);
React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"});
```
`Simulate` has a method for every event that React understands.