Created
April 5, 2017 19:18
-
-
Save carlosble/abed63b095e580bfa6afc91461815222 to your computer and use it in GitHub Desktop.
Testing components in isolation with Enzyme's shallow
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
| beforeEach(()=> { | |
| form = shallow(<AddressForm | |
| address={{}} | |
| actions={actions} | |
| />); | |
| }); | |
| it('contains exactly one email input for every address email', () => { | |
| let address = addressBuilder().withEmails([email0, email1]).build(); | |
| form.setProps({address: address}); | |
| const inputs = emailInputs(); | |
| expect(inputs.at(0).props().value).toBe(email0); | |
| expect(inputs.at(1).props().value).toBe(email1); | |
| expect(inputs.length).toBe(2); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment