Skip to content

Instantly share code, notes, and snippets.

@marr
Last active August 29, 2015 14:25
Show Gist options
  • Save marr/dc3c8be6114f2680bedd to your computer and use it in GitHub Desktop.
Save marr/dc3c8be6114f2680bedd to your computer and use it in GitHub Desktop.
it.only('picks up state change after promise', function(done) {
const input = TestUtils.renderIntoDocument(<input onChange={sinon.spy()} />);
const p = new Promise(function(resolve, reject) {
setTimeout(() => {
TestUtils.Simulate.change(React.findDOMNode(input));
resolve(true);
}, 10);
});
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