Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { mount } from 'enzyme';
- import { TextInput, PasswordInput } from 'a-plus-forms';
- import SignInForm from 'src/features/auth/signin_form';
- describe('<SignInForm /', () => {
- it('works beautifully', () => {
- const onSubmit = sinon.spy();
- const wrapper = mount(<SignInForm onSubmit={onSubmit} />);
- wrapper.find(TextInput).instance().value = 'nikolay';
- wrapper.find(PasswordInput).instance().value = 'b@(k0n!';
- wrapper.find('form').simulate('submit');
- expect(onSubmit).to.have.been.calledWith({
- username: 'nikolay', password: 'b@(k0n!'
- });
- });
- });
Add Comment
Please, Sign In to add comment