Created
April 5, 2017 19:22
-
-
Save carlosble/349b3004668a7f724f1cf46b8d508dff to your computer and use it in GitHub Desktop.
Spying on the action to test component in isolation
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
| it('deletes email when button is clicked', () => { | |
| let address = addressBuilder().withEmails([email0, email1]).build(); | |
| form.setProps({address: address}); | |
| actions.updateEmails = jest.fn((value) => { | |
| expect(value).toEqual(email1); | |
| }); | |
| const buttons = form.find(inputByClass(deleteEmailCss)); | |
| simulateClick(buttons.first()); | |
| expect(actions.updateEmails).toHaveBeenCalled(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment