Skip to content

Commit 7af8ee5

Browse files
codegoblinclaydiffrient
authored andcommitted
Update README.md to include testing gotchas (#136)
1 parent e4be332 commit 7af8ee5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ var App = React.createClass({
126126

127127
ReactDOM.render(<App/>, appElement);
128128
```
129+
# Testing
130+
131+
When using React Test Utils with this library, here are some things to keep in mind:
132+
- You need to set isOpen={true} on the modal component for it to render its children.
133+
- 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.
129134

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

0 commit comments

Comments
 (0)