jeudi 31 décembre 2015

React testing component unmount

Let's say I have the following scenario to be tested.

After firing close button I want to test if the component is unmounted. So I have:

component = ReactUtils.renderIntoDocument(....);
closeButton = ReactUtils.findRenderedDOMComponentWithClass(component, 'Close-Button');

ReactUtils.Simulate.click(closeButton);

//Assert if component is mounted?

Aucun commentaire:

Enregistrer un commentaire