diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index 8e3e8d2b702b..4be4a311c658 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -1,3 +1,4 @@ +import type * as reactNavigationNativeImport from '@react-navigation/native'; import {screen} from '@testing-library/react-native'; import type {ComponentType} from 'react'; import Onyx from 'react-native-onyx'; @@ -24,6 +25,15 @@ import wrapOnyxWithWaitForBatchedUpdates from '../utils/wrapOnyxWithWaitForBatch jest.mock('@libs/Permissions'); jest.mock('@hooks/useActiveWorkspace', () => jest.fn(() => ({activeWorkspaceID: undefined}))); +jest.mock('@react-navigation/native', () => ({ + ...jest.requireActual('@react-navigation/native'), + useNavigationState: () => undefined, + useIsFocused: () => true, + useRoute: () => ({name: 'Home'}), + useNavigation: () => undefined, + useFocusEffect: () => undefined, +})); + type LazyLoadLHNTestUtils = { fakePersonalDetails: PersonalDetailsList; }; diff --git a/tests/ui/WorkspaceCategoriesTest.tsx b/tests/ui/WorkspaceCategoriesTest.tsx index fc34be67f173..cdcba7295c0e 100644 --- a/tests/ui/WorkspaceCategoriesTest.tsx +++ b/tests/ui/WorkspaceCategoriesTest.tsx @@ -10,7 +10,7 @@ import {CurrentReportIDContextProvider} from '@hooks/useCurrentReportID'; import * as useResponsiveLayoutModule from '@hooks/useResponsiveLayout'; import type ResponsiveLayoutResult from '@hooks/useResponsiveLayout/types'; import * as Localize from '@libs/Localize'; -import createSplitNavigator from '@libs/Navigation/AppNavigator/createSplitNavigator'; +import createPlatformStackNavigator from '@libs/Navigation/PlatformStackNavigation/createPlatformStackNavigator'; import type {WorkspaceSplitNavigatorParamList} from '@navigation/types'; import WorkspaceCategoriesPage from '@pages/workspace/categories/WorkspaceCategoriesPage'; import CONST from '@src/CONST'; @@ -22,20 +22,20 @@ import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct' TestHelper.setupGlobalFetchMock(); -const Split = createSplitNavigator(); +const Stack = createPlatformStackNavigator(); const renderPage = (initialRouteName: typeof SCREENS.WORKSPACE.CATEGORIES, initialParams: WorkspaceSplitNavigatorParamList[typeof SCREENS.WORKSPACE.CATEGORIES]) => { return render( - - + - + ,