Skip to content

Commit

Permalink
Update README.md to include testing gotchas (reactjs#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
codegoblin authored and claydiffrient committed Apr 9, 2016
1 parent e4be332 commit 7af8ee5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ var App = React.createClass({

ReactDOM.render(<App/>, appElement);
```
# Testing

When using React Test Utils with this library, here are some things to keep in mind:
- You need to set isOpen={true} on the modal component for it to render its children.
- You need to use the `.portal` property, as in `ReactDOM.findDOMNode(renderedModal.portal)` or `TestUtils.scryRenderedDOMComponentsWithClass(Modal.portal, 'my-modal-class')` to acquire a handle to the inner contents of your modal.

By default the modal is closed when clicking outside of it (the overlay area). If you want to prevent this behavior you can
pass the 'shouldCloseOnOverlayClick' prop with 'false' value.
Expand Down

0 comments on commit 7af8ee5

Please sign in to comment.