summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js')
-rw-r--r--web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js b/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
index e47f2e6c..386c3a19 100644
--- a/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
+++ b/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
@@ -7,14 +7,17 @@ describe('UserRecoveryCodeForm', () => {
let userRecoveryCodeForm;
let mockNext;
let mockPrevious;
+ let mockSaveCode;
beforeEach(() => {
const mockTranslations = key => key;
mockNext = expect.createSpy();
mockPrevious = expect.createSpy();
+ mockSaveCode = expect.createSpy();
userRecoveryCodeForm = shallow(
<UserRecoveryCodeForm
- t={mockTranslations} next={mockNext} previous={mockPrevious}
+ t={mockTranslations} next={mockNext}
+ previous={mockPrevious} saveCode={mockSaveCode}
/>
);
});
@@ -44,4 +47,9 @@ describe('UserRecoveryCodeForm', () => {
userRecoveryCodeForm.find('BackLink').simulate('click');
expect(mockPrevious).toHaveBeenCalled();
});
+
+ it('saves code on input change', () => {
+ userRecoveryCodeForm.find('InputField').simulate('change', '123');
+ expect(mockSaveCode).toHaveBeenCalledWith('123');
+ });
});