I'm doing a simple shallow render on a component which has a button (<a>) with an onClick handler. I can correctly assert most of its properties, but I can't get asserting whether the button has been clicked (by using TestUtils.Simulate.click(output.props.children[1]) and a sinon.spy() passed in as handler) to work. TestUtils doesn't throw any Invariant Violation or whatever other error, the spy just never gets called. When I manually call it through this.props.children[1].props.onClick() it works. Is this expected behavior?
I'm doing a simple shallow render on a component which has a button (
<a>) with anonClickhandler. I can correctly assert most of its properties, but I can't get asserting whether the button has been clicked (by usingTestUtils.Simulate.click(output.props.children[1])and asinon.spy()passed in as handler) to work. TestUtils doesn't throw any Invariant Violation or whatever other error, the spy just never gets called. When I manually call it throughthis.props.children[1].props.onClick()it works. Is this expected behavior?