Created
August 27, 2015 07:11
-
-
Save marr/9e3f77e978b6aac132cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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