diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 7ec799c93e9b..878eeaaa65c4 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -615,7 +615,7 @@ function AuthScreens() { component={FeatureTrainingModalNavigator} listeners={modalScreenListeners} /> - {isOnboardingCompleted === false && ( + {isOnboardingCompleted === false && !Navigation.isValidateLoginFlow() && ( jest.fn()); +jest.mock('@libs/getIsNarrowLayout', () => jest.fn()); + +jest.mock('@pages/home/sidebar/NavigationTabBarAvatar'); +jest.mock('@src/components/Navigation/TopLevelNavigationTabBar'); + +const mockedGetIsNarrowLayout = getIsNarrowLayout as jest.MockedFunction; +const mockedUseResponsiveLayout = useResponsiveLayout as jest.MockedFunction; + +describe('Navigation', () => { + beforeEach(() => { + mockedGetIsNarrowLayout.mockReturnValue(false); + mockedUseResponsiveLayout.mockReturnValue({...CONST.NAVIGATION_TESTS.DEFAULT_USE_RESPONSIVE_LAYOUT_VALUE, shouldUseNarrowLayout: false}); + }); + + describe('isValidateLoginFlow', () => { + it('should return true when the current focused route is the validate login screen', () => { + // Given the navigation state with the validate login screen + render( + , + ); + + expect(Navigation.isValidateLoginFlow()).toBe(true); + }); + }); +}); diff --git a/tests/utils/TestNavigationContainer.tsx b/tests/utils/TestNavigationContainer.tsx index 982e46f793fd..0c3370f12de0 100644 --- a/tests/utils/TestNavigationContainer.tsx +++ b/tests/utils/TestNavigationContainer.tsx @@ -145,6 +145,10 @@ function TestNavigationContainer({initialState}: TestNavigationContainerProps) { name={NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR} component={TestSearchFullscreenNavigator} /> + );