summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
diff options
context:
space:
mode:
authorTulio Casagrande <tuliocasagrande@gmail.com>2017-04-04 13:14:34 -0300
committerGitHub <noreply@github.com>2017-04-04 13:14:34 -0300
commitf70c2827d41d1d805d6446670b861b7abf0761b1 (patch)
treedf266fda0c593a27c568215716d48d9994fbd344 /web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
parentaf454c71da106644eee644c4286bbae4788b8e14 (diff)
parentd7914b9b5640c3d85c6230a032180b2e64520bca (diff)
Merge pull request #1042 from pixelated/login-recovery-code
[#935] Sends user recovery code and password to account recovery endpoint
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');
+ });
});