diff options
author | Anike Arni <aarni@thoughtworks.com> | 2017-03-28 11:26:11 -0300 |
---|---|---|
committer | Anike Arni <aarni@thoughtworks.com> | 2017-03-28 11:44:41 -0300 |
commit | d39f2b2907aa49f5fa383d2246875220a77c818c (patch) | |
tree | 709d4060372048f90c6fa991586b572d3cdb913c /web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js | |
parent | 7a6419d1628db465ebd543fac187012e58b67138 (diff) |
[#932] Adds logic to go to next step
Diffstat (limited to 'web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js')
-rw-r--r-- | web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js b/web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js index 6df392fa..0e922212 100644 --- a/web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js +++ b/web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js @@ -5,10 +5,14 @@ import { AdminRecoveryCodeForm } from 'src/account_recovery/forms/admin_recovery describe('AdminRecoveryCodeForm', () => { let adminRecoveryCodeForm; + let mockNext; beforeEach(() => { const mockTranslations = key => key; - adminRecoveryCodeForm = shallow(<AdminRecoveryCodeForm t={mockTranslations} />); + mockNext = expect.createSpy(); + adminRecoveryCodeForm = shallow( + <AdminRecoveryCodeForm t={mockTranslations} next={mockNext} /> + ); }); it('renders title for admin recovery code', () => { @@ -26,4 +30,9 @@ describe('AdminRecoveryCodeForm', () => { it('renders button for next step', () => { expect(adminRecoveryCodeForm.find('SubmitButton').props().buttonText).toEqual('account-recovery.admin-form.button'); }); + + it('submits form to next step', () => { + adminRecoveryCodeForm.find('form').simulate('submit'); + expect(mockNext).toHaveBeenCalled(); + }); }); |