@@ -13,6 +13,13 @@ import { navigationRef } from '@/navigation/navigationRef';
1313import MutedAccountsScreen from '@/screens/settings/privacy/MutedAccountsScreen' ;
1414import { PROFILE , ROOT } from '@/utils/navigation/routeNames' ;
1515
16+ jest . mock ( '@react-navigation/native' , ( ) => {
17+ const actualNav = jest . requireActual ( '@react-navigation/native' ) ;
18+ return {
19+ ...actualNav ,
20+ useFocusEffect : jest . fn ( ) . mockImplementation ( ( callback ) => callback ( ) ) ,
21+ } ;
22+ } ) ;
1623jest . mock ( '@/hooks/profile/useUserMutes' , ( ) => ( { useUserMutes : jest . fn ( ) } ) ) ;
1724jest . mock ( '@/hooks/profile/useBlockMutation' , ( ) => ( { useBlockMutation : jest . fn ( ) } ) ) ;
1825jest . mock ( '@/hooks/profile/useFollowMutation' , ( ) => ( { useFollowMutation : jest . fn ( ) } ) ) ;
@@ -32,8 +39,9 @@ const setPlatformOS = (os: typeof _initialOS) => {
3239} ;
3340
3441describe ( 'MutedAccountsScreen' , ( ) => {
42+ const queryClient = new QueryClient ( ) ;
43+
3544 const renderWithClient = ( ui : ReactElement ) => {
36- const queryClient = new QueryClient ( ) ;
3745 return render ( ui , {
3846 wrapper : ( { children } ) => (
3947 < QueryClientProvider client = { queryClient } > { children } </ QueryClientProvider >
@@ -42,6 +50,7 @@ describe('MutedAccountsScreen', () => {
4250 } ;
4351
4452 beforeEach ( ( ) => {
53+ queryClient . clear ( ) ;
4554 jest . clearAllMocks ( ) ;
4655
4756 ( useTheme as jest . Mock ) . mockReturnValue ( { theme : 'light' } ) ;
0 commit comments