diff options
author | Anike Arni <anikarni@gmail.com> | 2017-03-29 15:48:33 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-29 15:48:33 -0300 |
commit | 3616a6b950b0fb9d3e4842f90878d0beb4d5bc3f (patch) | |
tree | 5064ad57cb88df4efefbb8c75a65c0b6dc822c83 /web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js | |
parent | 75eccfc3ea988a20919c95e892b314ccd816e7c2 (diff) | |
parent | 6daf4311d32ab64fa73292e131611ee6a38ff18a (diff) |
Merge pull request #1032 from pixelated/forgot-password-page
UI improvements for account recovery flow
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(); + }); }); |