Skip to content

Instantly share code, notes, and snippets.

@marr
Created August 27, 2015 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marr/9e3f77e978b6aac132cd to your computer and use it in GitHub Desktop.
Save marr/9e3f77e978b6aac132cd to your computer and use it in GitHub Desktop.
const React = require('react');
const TestUtils = React.addons.TestUtils;
const Checkbox = React.createClass({
render() {
return <input type="checkbox"></input>
}
});
describe('Checkbox', function() {
it('toggles its checked property on the DOM', function() {
const cb = TestUtils.renderIntoDocument(<Checkbox />);
const node = React.findDOMNode(cb);
expect(node.checked).to.be.false;
TestUtils.Simulate.click(node);
expect(node.checked).to.be.true;
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment