diff --git a/app/components/Views/ErrorBoundary/index.js b/app/components/Views/ErrorBoundary/index.js index a0c7af42270..603ebc4f312 100644 --- a/app/components/Views/ErrorBoundary/index.js +++ b/app/components/Views/ErrorBoundary/index.js @@ -40,7 +40,7 @@ import { } from '../../../components/hooks/useMetrics'; import AppConstants from '../../../core/AppConstants'; import { useSelector } from 'react-redux'; - +import { isTest } from '../../../util/test/utils'; // eslint-disable-next-line import/no-commonjs const WarningIcon = require('./warning-icon.png'); @@ -246,7 +246,6 @@ export const Fallback = (props) => { captureSentryFeedback({ sentryId: props.sentryId, comments: feedback }); Alert.alert(strings('error_screen.bug_report_thanks')); }; - return ( @@ -270,6 +269,14 @@ export const Fallback = (props) => { } /> + + {isTest && ( + + + {strings('error_screen.save_seedphrase_2')} + + + )} {strings('error_screen.error_message')} diff --git a/app/components/Views/Login/__snapshots__/index.test.tsx.snap b/app/components/Views/Login/__snapshots__/index.test.tsx.snap index 4beae542b9e..599cee47dee 100644 --- a/app/components/Views/Login/__snapshots__/index.test.tsx.snap +++ b/app/components/Views/Login/__snapshots__/index.test.tsx.snap @@ -186,6 +186,28 @@ exports[`Login should render correctly 1`] = ` + + + save your Secret Recovery Phrase + + { + beforeAll(async () => { + jest.setTimeout(2500000); + await TestHelpers.reverseServerPort(); + }); + + it('should trigger error boundary screen to reveal SRP', async () => { + await withFixtures( + { + dapp: true, + fixture: new FixtureBuilder() + .withGanacheNetwork() + .withPermissionControllerConnectedToTestDapp() + .build(), + restartDevice: true, + ganacheOptions: defaultGanacheOptions, + }, + async () => { + await loginToApp(); + + await TabBarComponent.tapBrowser(); + await Browser.navigateToTestDApp(); + + await TestDApp.tapInvalidSigButton(); + await Assertions.checkIfVisible(ErrorBoundaryView.title); + await ErrorBoundaryView.tapSRPLinkText(); + + await RevealSecretRecoveryPhrase.enterPasswordToRevealSecretCredential( + PASSWORD, + ); + // If the following step fails, ensure you are using a test build with tap and hold to reveal animation disabled + await RevealSecretRecoveryPhrase.tapToReveal(); + await Assertions.checkIfVisible(RevealSecretRecoveryPhrase.container); + + await Assertions.checkIfTextIsDisplayed(defaultGanacheOptions.mnemonic); + }, + ); + }); +});