@@ -336,99 +336,103 @@ describe('MoneyOnboardingCard', () => {
336336 expect ( mockIncrementStep ) . toHaveBeenCalledTimes ( 1 ) ;
337337 } ) ;
338338 } ) ;
339- } ) ;
340-
341- describe ( 'step 2 — cardholder with no linked card' , ( ) => {
342- beforeEach ( ( ) => {
343- jest . clearAllMocks ( ) ;
344- } ) ;
345339
346- it ( 'renders the unlinked-card title' , ( ) => {
347- setupDefaultMocks ( {
348- currentStep : 1 ,
349- isCardholder : true ,
350- moneyAccountCardToken : null ,
340+ describe ( 'step 2 — cardholder with no linked card' , ( ) => {
341+ beforeEach ( ( ) => {
342+ jest . clearAllMocks ( ) ;
351343 } ) ;
352344
353- const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
345+ it ( 'renders the unlinked-card title' , ( ) => {
346+ setupDefaultMocks ( {
347+ currentStep : 1 ,
348+ isCardholder : true ,
349+ moneyAccountCardToken : null ,
350+ } ) ;
354351
355- expect ( getByTestId ( 'money-onboarding-card-title' ) ) . toHaveTextContent (
356- strings ( 'money.onboarding.step_2.unlinked_card_account.title' ) ,
357- ) ;
358- } ) ;
352+ const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
359353
360- it ( 'renders the unlinked-card description' , ( ) => {
361- setupDefaultMocks ( {
362- currentStep : 1 ,
363- isCardholder : true ,
364- moneyAccountCardToken : null ,
354+ expect ( getByTestId ( 'money-onboarding-card-title' ) ) . toHaveTextContent (
355+ strings ( 'money.onboarding.step_2.unlinked_card_account.title' ) ,
356+ ) ;
365357 } ) ;
366358
367- const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
359+ it ( 'renders the unlinked-card description' , ( ) => {
360+ setupDefaultMocks ( {
361+ currentStep : 1 ,
362+ isCardholder : true ,
363+ moneyAccountCardToken : null ,
364+ } ) ;
368365
369- expect ( getByTestId ( 'money-onboarding-card-description' ) ) . toHaveTextContent (
370- strings ( 'money.onboarding.step_2.unlinked_card_account.description' ) ,
371- ) ;
372- } ) ;
366+ const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
373367
374- it ( 'renders the Link card primary CTA' , ( ) => {
375- setupDefaultMocks ( {
376- currentStep : 1 ,
377- isCardholder : true ,
378- moneyAccountCardToken : null ,
368+ expect (
369+ getByTestId ( 'money-onboarding-card-description' ) ,
370+ ) . toHaveTextContent (
371+ strings ( 'money.onboarding.step_2.unlinked_card_account.description' ) ,
372+ ) ;
379373 } ) ;
380374
381- const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
375+ it ( 'renders the Link card primary CTA' , ( ) => {
376+ setupDefaultMocks ( {
377+ currentStep : 1 ,
378+ isCardholder : true ,
379+ moneyAccountCardToken : null ,
380+ } ) ;
382381
383- expect ( getByTestId ( 'money-onboarding-card-cta-button' ) ) . toHaveTextContent (
384- strings ( 'money.onboarding.step_2.unlinked_card_account.cta_primary' ) ,
385- ) ;
386- } ) ;
382+ const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
387383
388- it ( 'calls openLinkCardSheet when Link card CTA is pressed and canLink is true' , ( ) => {
389- setupDefaultMocks ( {
390- currentStep : 1 ,
391- isCardholder : true ,
392- moneyAccountCardToken : null ,
393- canLink : true ,
384+ expect ( getByTestId ( 'money-onboarding-card-cta-button' ) ) . toHaveTextContent (
385+ strings ( 'money.onboarding.step_2.unlinked_card_account.cta_primary' ) ,
386+ ) ;
394387 } ) ;
395388
396- const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
397- fireEvent . press ( getByTestId ( 'money-onboarding-card-cta-button' ) ) ;
389+ it ( 'calls openLinkCardSheet when Link card CTA is pressed and canLink is true' , ( ) => {
390+ setupDefaultMocks ( {
391+ currentStep : 1 ,
392+ isCardholder : true ,
393+ moneyAccountCardToken : null ,
394+ canLink : true ,
395+ } ) ;
398396
399- expect ( mockOpenLinkCardSheet ) . toHaveBeenCalledTimes ( 1 ) ;
400- } ) ;
397+ const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
398+ fireEvent . press ( getByTestId ( 'money-onboarding-card-cta-button' ) ) ;
401399
402- it ( 'navigates to CARD.ROOT with CARD.HOME when Link card CTA is pressed and canLink is false' , ( ) => {
403- setupDefaultMocks ( {
404- currentStep : 1 ,
405- isCardholder : true ,
406- moneyAccountCardToken : null ,
407- canLink : false ,
400+ expect ( mockOpenLinkCardSheet ) . toHaveBeenCalledTimes ( 1 ) ;
408401 } ) ;
409402
410- const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
411- fireEvent . press ( getByTestId ( 'money-onboarding-card-cta-button' ) ) ;
403+ it ( 'navigates to CARD.ROOT with CARD.HOME when Link card CTA is pressed and canLink is false' , ( ) => {
404+ setupDefaultMocks ( {
405+ currentStep : 1 ,
406+ isCardholder : true ,
407+ moneyAccountCardToken : null ,
408+ canLink : false ,
409+ } ) ;
412410
413- expect ( mockNavigate ) . toHaveBeenCalledWith ( Routes . CARD . ROOT , {
414- screen : Routes . CARD . HOME ,
415- } ) ;
416- } ) ;
411+ const { getByTestId } = render ( < MoneyOnboardingCard /> ) ;
412+ fireEvent . press ( getByTestId ( 'money-onboarding-card-cta-button' ) ) ;
417413
418- it ( 'calls incrementStep when Skip CTA is pressed' , ( ) => {
419- setupDefaultMocks ( {
420- currentStep : 1 ,
421- isCardholder : true ,
422- moneyAccountCardToken : null ,
414+ expect ( mockNavigate ) . toHaveBeenCalledWith ( Routes . CARD . ROOT , {
415+ screen : Routes . CARD . HOME ,
416+ } ) ;
423417 } ) ;
424418
425- const { getByText } = render ( < MoneyOnboardingCard /> ) ;
426- fireEvent . press (
427- getByText (
428- strings ( 'money.onboarding.step_2.unlinked_card_account.cta_secondary' ) ,
429- ) ,
430- ) ;
419+ it ( 'calls incrementStep when Skip CTA is pressed' , ( ) => {
420+ setupDefaultMocks ( {
421+ currentStep : 1 ,
422+ isCardholder : true ,
423+ moneyAccountCardToken : null ,
424+ } ) ;
425+
426+ const { getByText } = render ( < MoneyOnboardingCard /> ) ;
427+ fireEvent . press (
428+ getByText (
429+ strings (
430+ 'money.onboarding.step_2.unlinked_card_account.cta_secondary' ,
431+ ) ,
432+ ) ,
433+ ) ;
431434
432- expect ( mockIncrementStep ) . toHaveBeenCalledTimes ( 1 ) ;
435+ expect ( mockIncrementStep ) . toHaveBeenCalledTimes ( 1 ) ;
436+ } ) ;
433437 } ) ;
434438} ) ;
0 commit comments