From 110f6af59822a6e1b80fe158c2b459951b6bbc78 Mon Sep 17 00:00:00 2001 From: Rahul Date: Wed, 29 May 2024 16:04:30 +0530 Subject: [PATCH] restore flow --- .../CardAboutPhrase/CardAboutPhrase.tsx | 4 +- .../ChooseMnemonicTypeScreen.tsx | 2 + .../VerifyRecoveryPhraseScreen.tsx | 2 +- .../CreateWallet/WalletDetailsScreen.tsx | 2 +- .../MnemonicInput/MnemonicInput.tsx | 5 +- .../RestoreWalletDetailsScreen.tsx | 5 +- .../RestoreWallet/RestoreWalletScreen.tsx | 2 +- .../screens/chooseMnemonicType.screen.ts | 4 ++ .../screens/createWalletSteps.screen.ts | 4 +- .../screens/restoreWalletFlow.screen.ts | 34 +++++++---- .../tests/_android/restore-wallet.test.ts | 54 ++++++++++-------- .../tests/_ios/create-wallet.test.ts | 2 +- .../tests/_ios/restore-wallet.test.ts | 56 ++++++++++--------- 13 files changed, 108 insertions(+), 68 deletions(-) create mode 100644 e2e/wallet-mobile/screens/chooseMnemonicType.screen.ts diff --git a/apps/wallet-mobile/src/features/SetupWallet/common/CardAboutPhrase/CardAboutPhrase.tsx b/apps/wallet-mobile/src/features/SetupWallet/common/CardAboutPhrase/CardAboutPhrase.tsx index 4651df9924..c02b69d82a 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/common/CardAboutPhrase/CardAboutPhrase.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/common/CardAboutPhrase/CardAboutPhrase.tsx @@ -40,7 +40,9 @@ export const CardAboutPhrase = ({ {title !== undefined && ( <> - {title} + + {title} + diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseMnemonicType/ChooseMnemonicTypeScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseMnemonicType/ChooseMnemonicTypeScreen.tsx index b976f5f30f..e023247966 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseMnemonicType/ChooseMnemonicTypeScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/ChooseMnemonicType/ChooseMnemonicTypeScreen.tsx @@ -51,6 +51,7 @@ export const ChooseMnemonicTypeScreen = () => { title={strings.choose15WordsMnemonicTitle} icon={} onPress={handle15Words} + testId="mnemonic-15-word" /> @@ -59,6 +60,7 @@ export const ChooseMnemonicTypeScreen = () => { title={strings.choose24WordsMnemonicTitle} icon={} onPress={handle24Words} + testId="mnemonic-24-word" /> diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/VerifyRecoveryPhraseScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/VerifyRecoveryPhraseScreen.tsx index cb8b1de93a..a0393e1cae 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/VerifyRecoveryPhraseScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/VerifyRecoveryPhraseScreen.tsx @@ -122,7 +122,7 @@ export const VerifyRecoveryPhraseScreen = () => { publicKeyHexChanged(accountPubKeyHex) navigation.navigate('setup-wallet-details-form') }} - testId="setup-step3-next-button" + testId="setup-next-button" /> diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx index 302c9baf80..1770760592 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/CreateWallet/WalletDetailsScreen.tsx @@ -186,7 +186,7 @@ export const WalletDetailsScreen = () => { closeModal() showRestoreWalletInfoModalChanged(false) }} - testId="setup-step4-modal-continue-button" + testId="setup-modal-continue-button" /> diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx index 6504faaeff..df92eddaf3 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/MnemonicInput/MnemonicInput.tsx @@ -89,6 +89,7 @@ export const MnemonicInput = ({ mnenonicRefs.forEach((ref) => ref.current?.selectWord('')) mnenonicRefs[0].current?.focus() }} + testId="clearAll-button" /> )} @@ -97,11 +98,11 @@ export const MnemonicInput = ({ ) } -const ClearAllButton = ({onPress}: {onPress: () => void}) => { +const ClearAllButton = ({onPress, testId}: {onPress: () => void; testId?: string}) => { const {styles} = useStyles() const strings = useStrings() return ( - + {strings.clearAll} diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx index 2659c2d5ff..736d7fa661 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletDetailsScreen.tsx @@ -285,7 +285,9 @@ export const RestoreWalletDetailsScreen = () => { - {plate.accountPlate.TextPart} + + {plate.accountPlate.TextPart} + @@ -307,6 +309,7 @@ export const RestoreWalletDetailsScreen = () => { addressMode, }) } + testId="setup-restore-step2-next-button" disabled={isLoading || Object.keys(passwordErrors).length > 0 || Object.keys(nameErrors).length > 0} /> diff --git a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx index f427d52499..529b72fa95 100644 --- a/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx +++ b/apps/wallet-mobile/src/features/SetupWallet/useCases/RestoreWallet/RestoreWalletScreen.tsx @@ -212,7 +212,7 @@ const NextButton = ({onPress}: {onPress: () => void}) => { return ( -