javascript - react test, how to test for unchecked state? -
i have test using simulate.click, tests input checked. how test when input unchecked?
var input = testutils.findrendereddomcomponentwithtag(instance, "input"); testutils.simulate.click(input); var data = this.stubbed.getlastpublished(); expect(data.topic === 'selected'); expect(data.id === 1); expect(input.checked === true);
thanks reply used:
testutils.simulate.click(input, { target: { checked: false } });
Comments
Post a Comment