Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rework cab for onboarding flow #5611

Merged
merged 62 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
381291e
feat: add cab in onboarding
MuckT Jun 28, 2024
209136b
Merge branch 'main' into tomm/act-1219
MuckT Jun 28, 2024
6d56803
fix: handle possible undefined origin
MuckT Jun 28, 2024
1720ed2
fix: resolve build errors
MuckT Jun 28, 2024
3717f10
chore: use onboarding background in account key education during onbo…
MuckT Jun 28, 2024
135b3ba
test: update snapshots and expected navigation
MuckT Jun 28, 2024
cde90a9
fix: remove unused styles
MuckT Jun 29, 2024
e037914
chore: remove onboarding background
MuckT Jun 29, 2024
aaef4c5
chore: remove onboarding background color
MuckT Jun 29, 2024
46325cb
fix: remove hardcoded feature gate
MuckT Jun 29, 2024
cc23b26
chore: update branding sha
MuckT Jun 29, 2024
1b20705
chore: update snapshot
MuckT Jun 29, 2024
b9d0691
fix: use correct steps during cab in onboarding
MuckT Jul 1, 2024
222e9a2
Merge branch 'main' into tomm/act-1219
MuckT Jul 1, 2024
224c95b
Merge branch 'main' into tomm/act-1219
MuckT Jul 1, 2024
7486173
test: update sign in with email bottom sheet bypass
MuckT Jul 1, 2024
1aee3c9
fix: use protect wallet steps on onboarding recovery phrase non cab flow
MuckT Jul 2, 2024
0a40ff3
style: remove use of nextScreen nav prop
MuckT Jul 2, 2024
f6119c9
fix: onboarding nav from biometrics to cab
MuckT Jul 3, 2024
998393f
fix: headers on android sign in with email
MuckT Jul 3, 2024
5c7f752
Merge branch 'main' into tomm/act-1219
MuckT Jul 3, 2024
bf4648e
Merge branch 'main' into tomm/act-1219
MuckT Jul 3, 2024
6970930
chore: add cab in onboarding analytic events
MuckT Jul 4, 2024
e075482
fix: right only alignment in custom header
MuckT Jul 4, 2024
aa511db
feat: use custom header in cab phone number and code input
MuckT Jul 4, 2024
98b72da
style: simplify origin param and adjust header in cab onboarding sign in
MuckT Jul 4, 2024
7f1df09
feat: rework cab progress to work in onboarding and use consistent style
MuckT Jul 4, 2024
0320f30
style: update test id for bottom sheet
MuckT Jul 4, 2024
0224ecb
style: is setup in onboarding
MuckT Jul 8, 2024
a053685
style: use destructured origin and flow
MuckT Jul 8, 2024
c998a0d
style: use is setup const
MuckT Jul 8, 2024
acb95ae
fix: remove unneeded keyless backup origin
MuckT Jul 8, 2024
32b452a
style: simplify title component of custom header
MuckT Jul 8, 2024
685f385
style: move functions into bottom sheet
MuckT Jul 8, 2024
353378a
Merge branch 'main' into tomm/act-1219
MuckT Jul 8, 2024
3030342
Merge branch 'tomm/act-1219' into tomm/act-1233
MuckT Jul 8, 2024
587392f
fix: only show header title during onboarding setup
MuckT Jul 8, 2024
48bd450
Merge branch 'tomm/act-1219' into tomm/act-1233
MuckT Jul 8, 2024
85474bc
style: pass header with subtitle to title prop of custom header
MuckT Jul 9, 2024
b93f45c
chore: remove unused subTitle prop
MuckT Jul 9, 2024
a2a2d07
fix: remove unnecessary steps
MuckT Jul 9, 2024
ddd7cb1
Merge branch 'main' into tomm/act-1219
MuckT Jul 9, 2024
e5b0c85
Merge branch 'tomm/act-1219' into tomm/act-1233
MuckT Jul 9, 2024
baaed98
style: use HeaderTitleWithSubtitle for onboarding header
MuckT Jul 9, 2024
0385484
fix: remove onboarding prop and navigate directly
MuckT Jul 9, 2024
ca8a587
style: remove extra empty line
MuckT Jul 9, 2024
720b06f
Merge branch 'tomm/act-1219' into tomm/act-1233
MuckT Jul 9, 2024
f797fdf
fix: navigate directly to account key education
MuckT Jul 9, 2024
03ba34c
fix: remove unnecessary ternary in onPressSkip
MuckT Jul 9, 2024
5defae2
test(cab): use navigate instead of goToNextOnboardingScreen
MuckT Jul 9, 2024
975808d
fix: navigation after cab setup success
MuckT Jul 10, 2024
0c97c18
Merge branch 'main' into tomm/act-1233
MuckT Jul 10, 2024
c21af76
test(cab-setup): navigates to correct screen after setup onboarding flow
MuckT Jul 10, 2024
19c59fa
style: alphabetize analytic events
MuckT Jul 10, 2024
b18ce9b
style: remove unnecessary views around single buttons
MuckT Jul 10, 2024
ab3724f
fix: icon placement for cab not found
MuckT Jul 10, 2024
30e1497
style: avoid code duplication with reusable container
MuckT Jul 11, 2024
9886de4
style: remove conditional onboarding styles
MuckT Jul 11, 2024
5402d6d
fix: remove unused props from KeylessBackupSetupContainer
MuckT Jul 11, 2024
f54214c
chore: add origin to cab completed event
MuckT Jul 11, 2024
779f017
test(cab): add origin to cab completed event
MuckT Jul 11, 2024
221cdcc
style: replace navigatedFromSettings with isOnboarding
MuckT Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/analytics/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,18 @@ export enum KeylessBackupEvents {
cab_sign_in_another_way = 'cab_sign_in_another_way',
cab_sign_in_with_google = 'cab_sign_in_with_google',
cab_sign_in_with_google_success = 'cab_sign_in_with_google_success',
cab_sign_in_with_email_screen_back = 'cab_sign_in_with_email_screen_back',
cab_sign_in_with_email_screen_cancel = 'cab_sign_in_with_email_screen_cancel',
cab_sign_in_with_email_screen_skip = 'cab_sign_in_with_email_screen_skip',
cab_get_torus_keyshare_failed = 'cab_get_torus_keyshare_failed',
cab_enter_phone_number_back = 'cab_enter_phone_number_back',
cab_enter_phone_number_continue = 'cab_enter_phone_number_continue',
cab_enter_phone_number_cancel = 'cab_enter_phone_number_cancel',
cab_intro_continue = 'cab_intro_continue',
cab_issue_sms_code_start = 'cab_issue_sms_code_start',
cab_issue_sms_code_success = 'cab_issue_sms_code_success',
cab_issue_sms_code_error = 'cab_issue_sms_code_error',
cab_enter_phone_code_back = 'cab_enter_phone_code_back',
cab_enter_phone_code_cancel = 'cab_enter_phone_code_cancel',
cab_issue_valora_keyshare_start = 'cab_issue_valora_keyshare_start',
cab_issue_valora_keyshare_success = 'cab_issue_valora_keyshare_success',
Expand Down
5 changes: 4 additions & 1 deletion src/analytics/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,17 @@ interface KeylessBackupEventsProperties {
[KeylessBackupEvents.cab_sign_in_another_way]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_sign_in_with_google]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_sign_in_with_google_success]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_sign_in_with_email_screen_back]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_sign_in_with_email_screen_cancel]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_sign_in_with_email_screen_skip]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_enter_phone_number_continue]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_enter_phone_number_back]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_enter_phone_number_cancel]: CommonKeylessBackupProps
MuckT marked this conversation as resolved.
Show resolved Hide resolved
[KeylessBackupEvents.cab_enter_phone_number_continue]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_intro_continue]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_issue_sms_code_start]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_issue_sms_code_success]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_issue_sms_code_error]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_enter_phone_code_back]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_enter_phone_code_cancel]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_issue_valora_keyshare_start]: CommonKeylessBackupProps
[KeylessBackupEvents.cab_issue_valora_keyshare_success]: CommonKeylessBackupProps
Expand Down
5 changes: 4 additions & 1 deletion src/analytics/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,18 @@ export const eventDocs: Record<AnalyticsEventType, string> = {
[KeylessBackupEvents.cab_sign_in_another_way]: `When the sign in another way button is pressed in the setup wallet backup screen`,
[KeylessBackupEvents.cab_sign_in_with_google]: ``,
[KeylessBackupEvents.cab_sign_in_with_google_success]: ``,
[KeylessBackupEvents.cab_sign_in_with_email_screen_back]: `When the back button is pressed on the sign in with email screen`,
[KeylessBackupEvents.cab_sign_in_with_email_screen_cancel]: ``,
[KeylessBackupEvents.cab_sign_in_with_email_screen_skip]: `When the skip button is pressed on the sign in with email bottom sheet`,
[KeylessBackupEvents.cab_get_torus_keyshare_failed]: ``,
[KeylessBackupEvents.cab_enter_phone_number_continue]: ``,
[KeylessBackupEvents.cab_enter_phone_number_back]: `When the back button is pressed on the phone input screen`,
[KeylessBackupEvents.cab_enter_phone_number_cancel]: `When the cancel button is pressed on the phone input screen`,
[KeylessBackupEvents.cab_enter_phone_number_continue]: ``,
[KeylessBackupEvents.cab_intro_continue]: `When the continue button is pressed on the keyless backup intro screen`,
[KeylessBackupEvents.cab_issue_sms_code_start]: ``,
[KeylessBackupEvents.cab_issue_sms_code_success]: ``,
[KeylessBackupEvents.cab_issue_sms_code_error]: ``,
[KeylessBackupEvents.cab_enter_phone_code_back]: `When the back button is pressed on the phone verification code input screen`,
[KeylessBackupEvents.cab_enter_phone_code_cancel]: `When the cancel button is pressed on the phone verification code input screen`,
[KeylessBackupEvents.cab_issue_valora_keyshare_start]: ``,
[KeylessBackupEvents.cab_issue_valora_keyshare_success]: ``,
Expand Down
3 changes: 2 additions & 1 deletion src/components/header/CustomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function CustomHeader({ left, right, title, style }: Props) {
return (
<View style={style ? [styles.container, style] : styles.container}>
{!!title && <View style={styles.titleContainer}>{titleComponent}</View>}
{!!left && <View style={styles.buttonContainer}>{left}</View>}
{/* Need left element to be an empty view if not provided for right alignment to work */}
{left ? <View style={styles.buttonContainer}>{left}</View> : <View />}
{!!right && <View style={styles.buttonContainer}>{right}</View>}
</View>
)
Expand Down
19 changes: 17 additions & 2 deletions src/keylessBackup/KeylessBackupPhoneCodeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import CustomHeader from 'src/components/header/CustomHeader'
import KeylessBackupCancelButton from 'src/keylessBackup/KeylessBackupCancelButton'
import { useVerifyPhoneNumber } from 'src/keylessBackup/hooks'
import { KeylessBackupFlow, KeylessBackupOrigin } from 'src/keylessBackup/types'
import { HeaderTitleWithSubtitle } from 'src/navigator/Headers'
import { navigate, navigateHome } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import { TopBarTextButton } from 'src/navigator/TopBarButton'
import { StackParamList } from 'src/navigator/types'
import { getOnboardingStepValues, onboardingPropsSelector } from 'src/onboarding/steps'
import { useSelector } from 'src/redux/hooks'
import colors from 'src/styles/colors'
import { typeScale } from 'src/styles/fonts'
import { Spacing } from 'src/styles/styles'
Expand Down Expand Up @@ -116,6 +119,8 @@ function KeylessBackupPhoneCodeInput({
keylessBackupFlow,
origin
)
const onboardingProps = useSelector(onboardingPropsSelector)
const { step, totalSteps } = getOnboardingStepValues(Screens.SignInWithEmail, onboardingProps)

const bottomSheetRef = useRef<BottomSheetRefType>(null)

Expand All @@ -131,7 +136,14 @@ function KeylessBackupPhoneCodeInput({
keylessBackupFlow === KeylessBackupFlow.Setup && origin === KeylessBackupOrigin.Onboarding

const headerLeft = isSetupInOnboarding ? (
<BackButton testID="BackButton" />
<BackButton
testID="BackButton"
eventName={KeylessBackupEvents.cab_enter_phone_code_back}
eventProperties={{
keylessBackupFlow,
origin,
}}
/>
) : (
<KeylessBackupCancelButton
flow={keylessBackupFlow}
Expand All @@ -155,7 +167,10 @@ function KeylessBackupPhoneCodeInput({
}
title={
isSetupInOnboarding && (
<Text style={styles.title}>{t('phoneVerificationInput.title')}</Text>
<HeaderTitleWithSubtitle
title={t('phoneVerificationInput.title')}
subTitle={t('registrationSteps', { step, totalSteps })}
/>
)
}
/>
Expand Down
3 changes: 2 additions & 1 deletion src/keylessBackup/KeylessBackupPhoneInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react'
import { Provider } from 'react-redux'
import KeylessBackupPhoneInput from 'src/keylessBackup/KeylessBackupPhoneInput'
import { KeylessBackupFlow } from 'src/keylessBackup/types'
import { noHeader } from 'src/navigator/Headers'
import MockedNavigator from 'test/MockedNavigator'
import { createMockStore } from 'test/utils'

Expand All @@ -25,7 +26,7 @@ describe('KeylessBackupPhoneInput', () => {
keylessBackupFlow: KeylessBackupFlow.Setup,
selectedCountryCodeAlpha2: 'US',
}}
options={KeylessBackupPhoneInput.navigationOptions}
options={noHeader}
/>
</Provider>
)
Expand Down
57 changes: 43 additions & 14 deletions src/keylessBackup/KeylessBackupPhoneInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@
import { NativeStackScreenProps } from '@react-navigation/native-stack'
import React, { useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { SafeAreaView, StyleSheet, Text } from 'react-native'
import { StyleSheet, Text } from 'react-native'
import * as RNLocalize from 'react-native-localize'
import { SafeAreaView } from 'react-native-safe-area-context'
import { defaultCountryCodeSelector, e164NumberSelector } from 'src/account/selectors'
import { getPhoneNumberDetails } from 'src/account/utils'
import { KeylessBackupEvents } from 'src/analytics/Events'
import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
import BackButton from 'src/components/BackButton'
import Button, { BtnSizes, BtnTypes } from 'src/components/Button'
import KeyboardAwareScrollView from 'src/components/KeyboardAwareScrollView'
import KeyboardSpacer from 'src/components/KeyboardSpacer'
import PhoneNumberInput from 'src/components/PhoneNumberInput'
import CustomHeader from 'src/components/header/CustomHeader'
import i18n from 'src/i18n'
import KeylessBackupCancelButton from 'src/keylessBackup/KeylessBackupCancelButton'
import { KeylessBackupFlow } from 'src/keylessBackup/types'
import { emptyHeader } from 'src/navigator/Headers'
import { KeylessBackupFlow, KeylessBackupOrigin } from 'src/keylessBackup/types'
import { HeaderTitleWithSubtitle } from 'src/navigator/Headers'
import { navigate } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import { StackParamList } from 'src/navigator/types'
import { getOnboardingStepValues, onboardingPropsSelector } from 'src/onboarding/steps'
import { useSelector } from 'src/redux/hooks'
import Colors from 'src/styles/colors'
import { typeScale } from 'src/styles/fonts'
import { Spacing } from 'src/styles/styles'
import variables from 'src/styles/variables'

type Props = NativeStackScreenProps<StackParamList, Screens.KeylessBackupPhoneInput>

Expand All @@ -31,6 +36,10 @@
const { selectedCountryCodeAlpha2, keylessBackupFlow, origin } = route.params
const cachedNumber = useSelector(e164NumberSelector)
const cachedCountryCallingCode = useSelector(defaultCountryCodeSelector)
const onboardingProps = useSelector(onboardingPropsSelector)
const { step, totalSteps } = getOnboardingStepValues(Screens.SignInWithEmail, onboardingProps)
const isSetupInOnboarding =
keylessBackupFlow === KeylessBackupFlow.Setup && origin === KeylessBackupOrigin.Onboarding
const countries = useMemo(() => new Countries(i18n.language), [i18n.language])
const [phoneNumberInfo, setPhoneNumberInfo] = useState(() =>
getPhoneNumberDetails(
Expand Down Expand Up @@ -98,6 +107,34 @@

return (
<SafeAreaView style={styles.container}>
<CustomHeader
style={styles.header}
left={
isSetupInOnboarding ? (
<BackButton
eventName={KeylessBackupEvents.cab_enter_phone_number_back}
eventProperties={{
keylessBackupFlow,
origin,
}}
/>
) : (
<KeylessBackupCancelButton
flow={keylessBackupFlow}
origin={origin}
eventName={KeylessBackupEvents.cab_enter_phone_number_cancel}
/>
)
}
title={
isSetupInOnboarding && (
<HeaderTitleWithSubtitle

Check warning on line 131 in src/keylessBackup/KeylessBackupPhoneInput.tsx

View check run for this annotation

Codecov / codecov/patch

src/keylessBackup/KeylessBackupPhoneInput.tsx#L131

Added line #L131 was not covered by tests
title={t('phoneVerificationScreen.screenTitle')}
subTitle={t('registrationSteps', { step, totalSteps })}
/>
)
}
/>
<KeyboardAwareScrollView style={styles.scrollContainer}>
<Text style={styles.title}>
{keylessBackupFlow === KeylessBackupFlow.Setup
Expand Down Expand Up @@ -132,17 +169,6 @@
)
}

KeylessBackupPhoneInput.navigationOptions = ({ route }: Props) => ({
...emptyHeader,
headerLeft: () => (
<KeylessBackupCancelButton
flow={route.params.keylessBackupFlow}
origin={route.params.origin}
eventName={KeylessBackupEvents.cab_enter_phone_number_cancel}
/>
),
})

export default KeylessBackupPhoneInput

const styles = StyleSheet.create({
Expand All @@ -153,6 +179,9 @@
scrollContainer: {
padding: Spacing.Thick24,
},
header: {
paddingHorizontal: variables.contentPadding,
},
title: {
...typeScale.labelSemiBoldLarge,
textAlign: 'center',
Expand Down
44 changes: 30 additions & 14 deletions src/keylessBackup/KeylessBackupProgress.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { ensurePincode, navigate, navigateHome } from 'src/navigator/NavigationS
import { Screens } from 'src/navigator/Screens'
import { goToNextOnboardingScreen } from 'src/onboarding/steps'
import Logger from 'src/utils/Logger'
import MockedNavigator from 'test/MockedNavigator'
import { createMockStore, getMockStackScreenProps } from 'test/utils'
import { mockOnboardingProps } from 'test/values'

Expand All @@ -26,6 +25,7 @@ jest.mock('src/utils/Logger')
jest.mock('src/onboarding/steps', () => ({
goToNextOnboardingScreen: jest.fn(),
onboardingPropsSelector: () => mockOnboardingPropsSelector(),
getOnboardingStepValues: () => ({ step: 2, totalSteps: 3 }),
}))

function createStore(keylessBackupStatus: KeylessBackupStatus, zeroBalance = false) {
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('KeylessBackupProgress', () => {
)
expect(getByTestId('GreenLoadingSpinner')).toBeTruthy()
})
it('navigates to home on success', async () => {
it('navigates to home on success of the non onboarding flow', async () => {
const { getByTestId } = render(
<Provider store={createStore(KeylessBackupStatus.Completed)}>
<KeylessBackupProgress {...getProps()} />
Expand All @@ -91,6 +91,29 @@ describe('KeylessBackupProgress', () => {
KeylessBackupEvents.cab_progress_completed_continue
)
})

it('navigates to next onboarding screen on success of the onboarding flow', async () => {
const { getByTestId } = render(
<Provider store={createStore(KeylessBackupStatus.Completed)}>
<KeylessBackupProgress
{...getProps(KeylessBackupFlow.Setup, KeylessBackupOrigin.Onboarding)}
/>
</Provider>
)
expect(getByTestId('GreenLoadingSpinnerToCheck')).toBeTruthy()
expect(getByTestId('KeylessBackupProgress/Continue')).toBeTruthy()
fireEvent.press(getByTestId('KeylessBackupProgress/Continue'))

expect(goToNextOnboardingScreen).toHaveBeenCalledWith({
onboardingProps: mockOnboardingProps,
firstScreenInCurrentStep: Screens.SignInWithEmail,
})
expect(ValoraAnalytics.track).toHaveBeenCalledTimes(1)
expect(ValoraAnalytics.track).toHaveBeenCalledWith(
KeylessBackupEvents.cab_progress_completed_continue
)
})

it('navigates to settings on failure', async () => {
const { getByTestId } = render(
<Provider store={createStore(KeylessBackupStatus.Failed)}>
Expand Down Expand Up @@ -139,8 +162,7 @@ describe('KeylessBackupProgress', () => {
expect(getByTestId('KeylessBackupProgress/ManualOnboarding')).toBeTruthy()
fireEvent.press(getByTestId('KeylessBackupProgress/ManualOnboarding'))

await waitFor(() => expect(navigate).toHaveBeenCalledTimes(1))
expect(navigate).toHaveBeenCalledWith(Screens.AccountKeyEducation)
expect(navigate).toBeCalledWith(Screens.AccountKeyEducation, { origin: 'cabOnboarding' })

expect(ValoraAnalytics.track).toHaveBeenCalledTimes(1)
expect(ValoraAnalytics.track).toHaveBeenCalledWith(
Expand All @@ -160,8 +182,7 @@ describe('KeylessBackupProgress', () => {
expect(getByTestId('KeylessBackupProgress/Skip')).toBeTruthy()
fireEvent.press(getByTestId('KeylessBackupProgress/Skip'))

await waitFor(() => expect(navigate).toHaveBeenCalledTimes(1))
expect(navigate).toHaveBeenCalledWith(Screens.ChooseYourAdventure)
expect(navigate).toBeCalledWith(Screens.ChooseYourAdventure)

expect(ValoraAnalytics.track).toHaveBeenCalledTimes(1)
expect(ValoraAnalytics.track).toHaveBeenCalledWith(
Expand Down Expand Up @@ -325,20 +346,15 @@ describe('KeylessBackupProgress', () => {
}
)
})

it('navigates to SupportContact screen on failure', async () => {
const { getByTestId } = render(
<Provider store={createStore(KeylessBackupStatus.Failed)}>
<KeylessBackupProgress {...getProps(KeylessBackupFlow.Restore)} />
<MockedNavigator
component={KeylessBackupProgress}
params={{
keylessBackupFlow: KeylessBackupFlow.Restore,
}}
/>
</Provider>
)
expect(getByTestId('KeylessBackupRestoreHelp')).toBeTruthy()
fireEvent.press(getByTestId('KeylessBackupRestoreHelp'))
expect(getByTestId('Header/KeylessBackupRestoreHelp')).toBeTruthy()
fireEvent.press(getByTestId('Header/KeylessBackupRestoreHelp'))

expect(navigate).toHaveBeenCalledTimes(1)
expect(navigate).toHaveBeenCalledWith(Screens.SupportContact)
Expand Down
Loading