Browse Source

Fix formatting in test utils docs

main
Ben Alpert 10 years ago
parent
commit
9e2c893767
  1. 2
      docs/10.4-test-utils.md

2
docs/10.4-test-utils.md

@ -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'

Loading…
Cancel
Save