@@ -5953,7 +5953,7 @@ describe('actions/Report', () => {
59535953 const testIntroSelected : OnyxTypes . IntroSelected = { choice : CONST . ONBOARDING_CHOICES . ADMIN } ;
59545954 const TEST_USER_ACCOUNT_ID = 1 ;
59555955 expect ( ( ) => {
5956- handleWalletStatementNavigation ( '123' , testIntroSelected , TEST_USER_ACCOUNT_ID , undefined , 'invalidType' , undefined ) ;
5956+ handleWalletStatementNavigation ( '123' , testIntroSelected , TEST_USER_ACCOUNT_ID , undefined , undefined , 'invalidType' , undefined ) ;
59575957 } ) . not . toThrow ( ) ;
59585958 } ) ;
59595959
@@ -5964,7 +5964,7 @@ describe('actions/Report', () => {
59645964 const testIntroSelected : OnyxTypes . IntroSelected = { choice : CONST . ONBOARDING_CHOICES . ADMIN } ;
59655965 const TEST_USER_ACCOUNT_ID = 1 ;
59665966
5967- handleWalletStatementNavigation ( '123' , testIntroSelected , TEST_USER_ACCOUNT_ID , undefined , CONST . WALLET . WEB_MESSAGE_TYPE . CONCIERGE , undefined ) ;
5967+ handleWalletStatementNavigation ( '123' , testIntroSelected , TEST_USER_ACCOUNT_ID , undefined , undefined , CONST . WALLET . WEB_MESSAGE_TYPE . CONCIERGE , undefined ) ;
59685968
59695969 await waitForBatchedUpdates ( ) ;
59705970
@@ -5975,7 +5975,38 @@ describe('actions/Report', () => {
59755975 it ( 'should not throw with undefined introSelected' , ( ) => {
59765976 const TEST_USER_ACCOUNT_ID = 1 ;
59775977 expect ( ( ) => {
5978- handleWalletStatementNavigation ( '123' , undefined , TEST_USER_ACCOUNT_ID , undefined , CONST . WALLET . WEB_MESSAGE_TYPE . CONCIERGE , undefined ) ;
5978+ handleWalletStatementNavigation ( '123' , undefined , TEST_USER_ACCOUNT_ID , undefined , undefined , CONST . WALLET . WEB_MESSAGE_TYPE . CONCIERGE , undefined ) ;
5979+ } ) . not . toThrow ( ) ;
5980+ } ) ;
5981+
5982+ it ( 'should pass isSelfTourViewed=true to navigateToConciergeChat when selfTour has been viewed' , async ( ) => {
5983+ const mockNavigateToConciergeChat = jest . fn ( ) ;
5984+ jest . mock ( '@userActions/Report' , ( ) => ( {
5985+ ...jest . requireActual < Record < string , unknown > > ( '@userActions/Report' ) ,
5986+ navigateToConciergeChat : mockNavigateToConciergeChat ,
5987+ } ) ) ;
5988+
5989+ jest . resetModules ( ) ;
5990+ const localHandleWalletStatementNavigation = jest . requireActual < { default : typeof handleWalletStatementNavigationDefault } > (
5991+ '@components/WalletStatementModal/walletNavigationUtils' ,
5992+ ) . default ;
5993+
5994+ const testIntroSelected : OnyxTypes . IntroSelected = { choice : CONST . ONBOARDING_CHOICES . ADMIN } ;
5995+ const TEST_USER_ACCOUNT_ID = 1 ;
5996+ const isSelfTourViewed = true ;
5997+
5998+ expect ( ( ) => {
5999+ localHandleWalletStatementNavigation ( '123' , testIntroSelected , TEST_USER_ACCOUNT_ID , isSelfTourViewed , undefined , CONST . WALLET . WEB_MESSAGE_TYPE . CONCIERGE , undefined ) ;
6000+ } ) . not . toThrow ( ) ;
6001+ } ) ;
6002+
6003+ it ( 'should pass isSelfTourViewed=false to navigateToConciergeChat when selfTour has not been viewed' , ( ) => {
6004+ const testIntroSelected : OnyxTypes . IntroSelected = { choice : CONST . ONBOARDING_CHOICES . ADMIN } ;
6005+ const TEST_USER_ACCOUNT_ID = 1 ;
6006+ const isSelfTourViewed = false ;
6007+
6008+ expect ( ( ) => {
6009+ handleWalletStatementNavigation ( '123' , testIntroSelected , TEST_USER_ACCOUNT_ID , isSelfTourViewed , undefined , CONST . WALLET . WEB_MESSAGE_TYPE . CONCIERGE , undefined ) ;
59796010 } ) . not . toThrow ( ) ;
59806011 } ) ;
59816012 } ) ;
0 commit comments