Guest User

Untitled

a guest
Dec 9th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import { mount } from 'enzyme';
  2. import { TextInput, PasswordInput } from 'a-plus-forms';
  3. import SignInForm from 'src/features/auth/signin_form';
  4.  
  5. describe('<SignInForm /', () => {
  6. it('works beautifully', () => {
  7. const onSubmit = sinon.spy();
  8. const wrapper = mount(<SignInForm onSubmit={onSubmit} />);
  9.  
  10. wrapper.find(TextInput).instance().value = 'nikolay';
  11. wrapper.find(PasswordInput).instance().value = 'b@(k0n!';
  12.  
  13. wrapper.find('form').simulate('submit');
  14.  
  15. expect(onSubmit).to.have.been.calledWith({
  16. username: 'nikolay', password: 'b@(k0n!'
  17. });
  18. });
  19. });
Add Comment
Please, Sign In to add comment