From 8c4b36a93e8e089186e0ffce5aecc97d3ce9e8bc Mon Sep 17 00:00:00 2001 From: Sriram Viswanathan Date: Tue, 4 Apr 2017 18:27:19 -0300 Subject: [#938] Adds link to backup-account on the backup account step with @anikarni --- .../backup_account_step/backup_account_step.js | 6 ++++++ .../backup_account_step/backup_account_step.spec.js | 14 ++++++++++++++ web-ui/src/common/submit_button/submit_button.js | 3 ++- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/backup_account_step/backup_account_step.js b/web-ui/src/account_recovery/backup_account_step/backup_account_step.js index b4dcbaaf..f2498a8a 100644 --- a/web-ui/src/account_recovery/backup_account_step/backup_account_step.js +++ b/web-ui/src/account_recovery/backup_account_step/backup_account_step.js @@ -16,6 +16,7 @@ */ import React from "react"; import {translate} from "react-i18next"; +import SubmitButton from 'src/common/submit_button/submit_button'; export const BackupAccountStep = ({ t }) => (
@@ -25,6 +26,11 @@ export const BackupAccountStep = ({ t }) => ( alt={t('account-recovery.backup-account-step.image-description')} />

{t('account-recovery.backup-account-step.title')}

+
); diff --git a/web-ui/src/account_recovery/backup_account_step/backup_account_step.spec.js b/web-ui/src/account_recovery/backup_account_step/backup_account_step.spec.js index 3b27b369..561079c9 100644 --- a/web-ui/src/account_recovery/backup_account_step/backup_account_step.spec.js +++ b/web-ui/src/account_recovery/backup_account_step/backup_account_step.spec.js @@ -2,6 +2,7 @@ import { shallow } from 'enzyme'; import expect from 'expect'; import React from 'react'; import { BackupAccountStep } from './backup_account_step'; +import SubmitButton from 'src/common/submit_button/submit_button'; describe('BackupAccountStep', () => { let backupAccountStep; @@ -14,4 +15,17 @@ describe('BackupAccountStep', () => { it('renders title for backup account step', () => { expect(backupAccountStep.find('h1').text()).toEqual('account-recovery.backup-account-step.title'); }); + + it('renders submit button with given href', () => { + expect(backupAccountStep.find(SubmitButton).props().href).toEqual('/backup-account'); + }); + + it('renders submit button with given container element', () => { + expect(backupAccountStep.find(SubmitButton).props().containerElement).toEqual('a'); + }); + + it('renders submit button with given button text', () => { + expect(backupAccountStep.find(SubmitButton).props().buttonText) + .toEqual('account-recovery.backup-account-step.buttonText'); + }); }); diff --git a/web-ui/src/common/submit_button/submit_button.js b/web-ui/src/common/submit_button/submit_button.js index 1224c7bd..f77a5596 100644 --- a/web-ui/src/common/submit_button/submit_button.js +++ b/web-ui/src/common/submit_button/submit_button.js @@ -30,7 +30,7 @@ const buttonStyle = { height: '48px' }; -const SubmitButton = ({ buttonText, disabled = false }) => ( +const SubmitButton = ({ buttonText, disabled = false, ...other }) => (
( overlayStyle={buttonStyle} fullWidth primary + {...other} />
); -- cgit v1.2.3