-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.test.tsx
37 lines (32 loc) · 1.08 KB
/
App.test.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import {render} from '@testing-library/react-native';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import configureMockStore from 'redux-mock-store';
import {NavigationContainer} from '@react-navigation/native';
import App from './App';
import {persistor} from './app/core/store/store';
// Mock necessary parts of the app
jest.mock('redux-persist/integration/react', () => ({
PersistGate: ({children}: {children: React.ReactNode}) => children,
}));
jest.mock('@react-navigation/native', () => ({
NavigationContainer: ({children}: {children: React.ReactNode}) => children,
}));
// Create a mock store
const mockStore = configureMockStore();
const store = mockStore({});
describe('App', () => {
it('renders correctly', () => {
const {} = render(
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<NavigationContainer>
<App />
</NavigationContainer>
</PersistGate>
</Provider>,
);
expect(true).toBe(true);
});
});