Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
[#932] Adds user recovery code form
Browse files Browse the repository at this point in the history
  • Loading branch information
Anike Arni committed Mar 28, 2017
1 parent 444b399 commit 815c8f2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web-ui/app/locales/en_US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@
"button": "Next"
},
"user-form": {
"title": "Remember your backup account?"
"title": "Remember your backup account?",
"description": "When you created your account you received a message - it was sent by [email protected]. You'll need the recovery code that is in it.",
"input-label": "type here your backup code",
"button": "Next"
}
},
"backup-account": {
Expand Down
6 changes: 6 additions & 0 deletions web-ui/src/account_recovery/forms/user_recovery_code_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@
import React from 'react';
import { translate } from 'react-i18next';

import InputField from 'src/common/input_field/input_field';
import SubmitButton from 'src/common/submit_button/submit_button';

export const UserRecoveryCodeForm = ({ t }) => (
<form>
<h1>{t('account-recovery.user-form.title')}</h1>
<p>{t('account-recovery.user-form.description')}</p>
<InputField name='admin-code' label={t('account-recovery.user-form.input-label')} />
<SubmitButton buttonText={t('account-recovery.user-form.button')} />
</form>
);

Expand Down
12 changes: 12 additions & 0 deletions web-ui/src/account_recovery/forms/user_recovery_code_form.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ describe('UserRecoveryCodeForm', () => {
it('renders title for user recovery code', () => {
expect(userRecoveryCodeForm.find('h1').text()).toEqual('account-recovery.user-form.title');
});

it('renders description', () => {
expect(userRecoveryCodeForm.find('p').text()).toEqual('account-recovery.user-form.description');
});

it('renders input for user code', () => {
expect(userRecoveryCodeForm.find('InputField').props().label).toEqual('account-recovery.user-form.input-label');
});

it('renders submit button', () => {
expect(userRecoveryCodeForm.find('SubmitButton').props().buttonText).toEqual('account-recovery.user-form.button');
});
});

0 comments on commit 815c8f2

Please sign in to comment.