Skip to content

Instantly share code, notes, and snippets.

@marr
Created July 23, 2015 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marr/682f88f4f7c37aca40ea to your computer and use it in GitHub Desktop.
Save marr/682f88f4f7c37aca40ea to your computer and use it in GitHub Desktop.
const input = TestUtils.renderIntoDocument(<input onChange={sinon.spy()} />);
const p = new Promise(function(resolve, reject) {
TestUtils.Simulate.change(React.findDOMNode(input));
resolve(true);
});
p.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