Instantly share code, notes, and snippets.

@whtswrng whtswrng/.js
Last active Nov 27, 2018

Embed
What would you like to do?
react-testing-1
describe("when input changed", () => {
it("should change property name in the state", () => {
const componentWrapper = shallow(<Login />);
componentWrapper.find('#email').simulate('change', {target: {name: 'email', value: 'blah@gmail.com'}});
expect(componentWrapper.state('email')).toEqual('blah@gmail.com');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment