summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/forms/admin_recovery_code_form.spec.js
diff options
context:
space:
mode:
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.js11
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();
+ });
});