假设我有以下方案需要测试。
触发关闭按钮后,我想测试组件是否已卸载。所以我有:
component = ReactUtils.renderIntoDocument(....);
closeButton = ReactUtils.findRenderedDOMComponentWithClass(component, 'Close-Button');
ReactUtils.Simulate.click(closeButton);
//Assert if component is mounted?