Skip to content

Commit

Permalink
Merge pull request #1493 from blockchain/new-data-e2e-tags
Browse files Browse the repository at this point in the history
new data-e2e tags for backup funds functionality
  • Loading branch information
schnogz committed Mar 1, 2019
2 parents abc11bb + e041210 commit 1e7feb6
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ const FirstStep = props => {
defaultMessage='We created a printable backup sheet to give you a place to write down your 12 word phrase and keep it safe. Please print the blank sheet (or grab a piece of paper) and move on to the next step.'
/>
</Text>
<Link href={recoveryPdf} download='recovery_phrase.pdf'>
<Link
href={recoveryPdf}
download='recovery_phrase.pdf'
data-e2e='downloadRecoveryPhraseLink'
>
<Button nature='empty'>
<Image
name='printer'
Expand All @@ -83,13 +87,21 @@ const FirstStep = props => {
</Link>
</PrintContainer>
<Buttons>
<Button nature='empty' onClick={props.handleClose}>
<Button
nature='empty'
onClick={props.handleClose}
data-e2e='backupFundsCancelButton'
>
<FormattedMessage
id='scenes.security.2fa.cancel'
defaultMessage='Cancel'
/>
</Button>
<Button nature='primary' onClick={nextStep}>
<Button
nature='primary'
onClick={nextStep}
data-e2e='backupFundsProceedButton'
>
<FormattedMessage
id='modals.recoveryphrase.firststep.backup'
defaultMessage='Backup Funds'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,44 @@ const SecondStep = props => {
<Wrapper>
<Container>
{words.map((word, index) => {
return <Word key={index}>{word}</Word>
return (
<Word key={index} data-e2e='backupWords'>
{word}
</Word>
)
})}
</Container>
<Buttons>
{step === 1 ? (
<Button nature='empty' onClick={props.handleClose}>
<Button
nature='empty'
onClick={props.handleClose}
data-e2e='backupPhraseCancelButton'
>
<FormattedMessage
id='scenes.security.2fa.cancel'
defaultMessage='Cancel'
/>
</Button>
) : (
<Button onClick={handleClickPrevious} nature='empty'>
<Button
onClick={handleClickPrevious}
nature='empty'
data-e2e='previous4WordsButton'
>
<FormattedMessage
id='modals.recoveryphrase.secondstep.prevfourwords'
defaultMessage='Previous 4 Words'
/>
</Button>
)}
{step === 3 ? (
<Button onClick={nextStep} style={spacing('ml-15')} nature='primary'>
<Button
onClick={nextStep}
style={spacing('ml-15')}
nature='primary'
data-e2e='finishAndVerifyButton'
>
<FormattedMessage
id='modals.recoveryphrase.secondstep.finishandcheckphrase'
defaultMessage='Finish & Verify'
Expand All @@ -81,6 +98,7 @@ const SecondStep = props => {
onClick={handleClickNext}
style={spacing('ml-15')}
nature='primary'
data-e2e='next4WordsButton'
>
<FormattedMessage
id='modals.recoveryphrase.secondstep.nextfourwords'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ const ThirdStep = props => {
<Container>
{indexes.map(index => (
<WordContainer key={index}>
<Text size='14px' weight={300} style={{ marginBottom: '4px' }}>
<Text
size='14px'
weight={300}
style={{ marginBottom: '4px' }}
data-e2e='wordLabel'
>
{`${languageHelper(index)} word`}
</Text>
<Field
Expand All @@ -83,12 +88,17 @@ const ThirdStep = props => {
validate={[required]}
errorBottom
noLastPass
data-e2e='wordInput'
/>
</WordContainer>
))}
</Container>
<Buttons>
<Button onClick={previousStep} nature='empty'>
<Button
onClick={previousStep}
nature='empty'
data-e2e='reviewBackupPhraseButton'
>
<Text weight={300} cursor='pointer'>
<FormattedMessage
id='scenes.securitycenter.walletrecoveryphrase.thirdstep.review'
Expand All @@ -101,6 +111,7 @@ const ThirdStep = props => {
nature='primary'
disabled={submitting || invalid}
style={spacing('ml-15')}
data-e2e='confirmBackupPhraseButton'
>
<FormattedMessage
id='scenes.securitycenter.walletrecoveryphrase.thirdstep.confirm'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ const WalletRecoveryPhrase = props => {
if (!nextStepToggled) {
if (!descriptionToggled && isMnemonicVerified) {
const againBtn = (
<BackupButton nature='primary' onClick={props.toggleNextStep}>
<BackupButton
nature='primary'
onClick={props.toggleNextStep}
data-e2e='backupFundsButton'
>
<FormattedMessage
id='scenes.securitysettings.basicsecurity.walletrecovery.settings.backupagain'
defaultMessage='Backup Again'
Expand All @@ -74,7 +78,11 @@ const WalletRecoveryPhrase = props => {
return securityComponent(againBtn)
} else if (!descriptionToggled) {
const backupBtn = (
<BackupButton nature='primary' onClick={props.toggleNextStep}>
<BackupButton
nature='primary'
onClick={props.toggleNextStep}
data-e2e='backupFundsButton'
>
<FormattedMessage
id='scenes.securitysettings.basicsecurity.walletrecovery.settings.backupfunds'
defaultMessage='Backup Funds'
Expand Down

0 comments on commit 1e7feb6

Please sign in to comment.