diff options
author | Anike Arni <aarni@thoughtworks.com> | 2017-03-28 15:33:55 -0300 |
---|---|---|
committer | Anike Arni <aarni@thoughtworks.com> | 2017-03-28 18:06:41 -0300 |
commit | 1ec36fb45d48cadd98ec7188414fa6de4d9455ad (patch) | |
tree | ab683719ccbe6a09de4fd1058009b148ec2d0f40 /web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js | |
parent | 9f0b66ae8fa5daac158f7c74919c0636882a550f (diff) |
[#932] Adds back link to account recovery steps
Diffstat (limited to 'web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js')
-rw-r--r-- | web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js b/web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js index a20d3b7b..1aebb814 100644 --- a/web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js +++ b/web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js @@ -6,12 +6,16 @@ import { UserRecoveryCodeForm } from 'src/account_recovery/forms/user_recovery_c describe('UserRecoveryCodeForm', () => { let userRecoveryCodeForm; let mockNext; + let mockPrevious; beforeEach(() => { const mockTranslations = key => key; mockNext = expect.createSpy(); + mockPrevious = expect.createSpy(); userRecoveryCodeForm = shallow( - <UserRecoveryCodeForm t={mockTranslations} next={mockNext} /> + <UserRecoveryCodeForm + t={mockTranslations} next={mockNext} previous={mockPrevious} + /> ); }); @@ -35,4 +39,14 @@ describe('UserRecoveryCodeForm', () => { userRecoveryCodeForm.find('form').simulate('submit'); expect(mockNext).toHaveBeenCalled(); }); + + it('returns to previous step on link click', () => { + userRecoveryCodeForm.find('BackLink').simulate('click'); + expect(mockPrevious).toHaveBeenCalled(); + }); + + it('returns to previous step on key down', () => { + userRecoveryCodeForm.find('BackLink').simulate('keyDown'); + expect(mockPrevious).toHaveBeenCalled(); + }); }); |