summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-03-30 17:23:41 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-03-31 18:29:48 -0300
commit7be03150100d319c6d373241f614a29b374cb74d (patch)
tree90a553dfa0b6f119300a00e6ef02788923035e5c /web-ui/src/account_recovery/user_recovery_code_form/user_recovery_code_form.spec.js
parentf40808a147d1135e8bbee6d78306a598cf5ca647 (diff)
[#935] Submits user recovery code to new endpoint
with @deniscostadsc
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');
+ });
});