mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix formatting in test utils docs
(cherry picked from commit 66881ae083)
This commit is contained in:
@@ -17,12 +17,14 @@ Simulate.{eventName}(DOMElement element, object eventData)
|
||||
Simulate an event dispatch on a DOM node with optional `eventData` event data. **This is possibly the single most useful utility in `ReactTestUtils`.**
|
||||
|
||||
**Clicking an element**
|
||||
|
||||
```javascript
|
||||
var node = React.findDOMNode(this.refs.button);
|
||||
React.addons.TestUtils.Simulate.click(node);
|
||||
```
|
||||
|
||||
**Changing the value of an input field and then pressing ENTER**
|
||||
|
||||
```javascript
|
||||
var node = React.findDOMNode(this.refs.input);
|
||||
node.value = 'giraffe'
|
||||
|
||||
Reference in New Issue
Block a user