Skip to content

Instantly share code, notes, and snippets.

@marr
Created July 23, 2015 23:49
Show Gist options
  • Save marr/8338211251f6a0ceece7 to your computer and use it in GitHub Desktop.
Save marr/8338211251f6a0ceece7 to your computer and use it in GitHub Desktop.
const input = TestUtils.renderIntoDocument(<input onChange={sinon.spy()} />);
Promise.resolve(true).then(result => {
TestUtils.Simulate.change(React.findDOMNode(input));
return result;
}).then(function(result) {
expect(result).to.be.true;
expect(input.props.onChange).has.been.calledOnce;
}).then(done, done);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment