summaryrefslogtreecommitdiff
path: root/web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-03-28 18:59:33 -0300
committerAnike Arni <aarni@thoughtworks.com>2017-03-30 15:10:56 -0300
commit8d49edac6af9dd08f1bb7b1727aee36af413a4a2 (patch)
treeefe254802984e3215da4ec86d236742f150d2b8c /web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js
parent7acb6843bd21dbf29cc7903964b52f6e21188df4 (diff)
[#932] Moves form componentes to separate directories
with @deniscostadsc
Diffstat (limited to 'web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js')
-rw-r--r--web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js b/web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js
new file mode 100644
index 00000000..85b75652
--- /dev/null
+++ b/web-ui/src/account_recovery/admin_recovery_code_form/admin_recovery_code_form.spec.js
@@ -0,0 +1,38 @@
+import { shallow } from 'enzyme';
+import expect from 'expect';
+import React from 'react';
+import { AdminRecoveryCodeForm } from './admin_recovery_code_form';
+
+describe('AdminRecoveryCodeForm', () => {
+ let adminRecoveryCodeForm;
+ let mockNext;
+
+ beforeEach(() => {
+ const mockTranslations = key => key;
+ mockNext = expect.createSpy();
+ adminRecoveryCodeForm = shallow(
+ <AdminRecoveryCodeForm t={mockTranslations} next={mockNext} />
+ );
+ });
+
+ it('renders title for admin recovery code', () => {
+ expect(adminRecoveryCodeForm.find('h1').text()).toEqual('account-recovery.admin-form.title');
+ });
+
+ it('renders tips for retrieving recovery code', () => {
+ expect(adminRecoveryCodeForm.find('li').length).toEqual(3);
+ });
+
+ it('renders input field for admin code', () => {
+ expect(adminRecoveryCodeForm.find('InputField').props().name).toEqual('admin-code');
+ });
+
+ 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();
+ });
+});