Created
December 7, 2017 05:27
-
-
Save kaievns/320cfaeec7a45e3df9e0d77604a55808 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!' | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment