Skip to content

Commit

Permalink
FormsySpec: test that onChange is called only once
Browse files Browse the repository at this point in the history
  • Loading branch information
sdemjanenko committed Dec 10, 2015
1 parent b39fd2e commit fec4576
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Formsy-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export default {

},

'should trigger onChange when form element is changed': function (test) {
'should trigger onChange once when form element is changed': function (test) {

const hasChanged = sinon.spy();
const form = TestUtils.renderIntoDocument(
Expand All @@ -359,12 +359,12 @@ export default {
</Formsy.Form>
);
TestUtils.Simulate.change(TestUtils.findRenderedDOMComponentWithTag(form, 'INPUT'), {target: {value: 'bar'}});
test.equal(hasChanged.called, true);
test.equal(hasChanged.calledOnce, true);
test.done();

},

'should trigger onChange when new input is added to form': function (test) {
'should trigger onChange once when new input is added to form': function (test) {

const hasChanged = sinon.spy();
const TestForm = React.createClass({
Expand Down Expand Up @@ -394,7 +394,7 @@ export default {
const form = TestUtils.renderIntoDocument(<TestForm/>);
form.addInput();
immediate(() => {
test.equal(hasChanged.called, true);
test.equal(hasChanged.calledOnce, true);
test.done();
});

Expand Down

0 comments on commit fec4576

Please sign in to comment.