Skip to content

Commit 8c9ebc4

Browse files
committed
fix: SafeArea for Mandatory Modal test
1 parent 04da619 commit 8c9ebc4

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

app/component-library/components/Modals/ModalMandatory/ModalMandatory.test.tsx

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import ModalMandatory from './ModalMandatory';
33
import renderWithProvider from '../../../../util/test/renderWithProvider';
4+
import { SafeAreaProvider } from 'react-native-safe-area-context';
45
const mockedNavigate = jest.fn();
56

67
jest.mock('@react-navigation/native', () => {
@@ -15,35 +16,39 @@ jest.mock('@react-navigation/native', () => {
1516
describe('Mandatory Modal', () => {
1617
it('should render correctly webview mandatory modal', () => {
1718
const { toJSON } = renderWithProvider(
18-
<ModalMandatory
19-
route={{
20-
params: {
21-
headerTitle: 'test',
22-
footerHelpText: 'test',
23-
buttonText: 'test',
24-
body: { source: 'WebView', uri: 'http://google.com' },
25-
onAccept: () => null,
26-
checkboxText: 'test',
27-
},
28-
}}
29-
/>,
19+
<SafeAreaProvider>
20+
<ModalMandatory
21+
route={{
22+
params: {
23+
headerTitle: 'test',
24+
footerHelpText: 'test',
25+
buttonText: 'test',
26+
body: { source: 'WebView', uri: 'http://google.com' },
27+
onAccept: () => null,
28+
checkboxText: 'test',
29+
},
30+
}}
31+
/>
32+
</SafeAreaProvider>,
3033
);
3134
expect(toJSON).toMatchSnapshot();
3235
});
3336
it('should render correctly component mandatory modal', () => {
3437
const { toJSON } = renderWithProvider(
35-
<ModalMandatory
36-
route={{
37-
params: {
38-
headerTitle: 'test',
39-
footerHelpText: 'test',
40-
buttonText: 'test',
41-
body: { source: 'Node', component: () => <></> },
42-
onAccept: () => null,
43-
checkboxText: 'test',
44-
},
45-
}}
46-
/>,
38+
<SafeAreaProvider>
39+
<ModalMandatory
40+
route={{
41+
params: {
42+
headerTitle: 'test',
43+
footerHelpText: 'test',
44+
buttonText: 'test',
45+
body: { source: 'Node', component: () => <></> },
46+
onAccept: () => null,
47+
checkboxText: 'test',
48+
},
49+
}}
50+
/>
51+
</SafeAreaProvider>,
4752
);
4853
expect(toJSON).toMatchSnapshot();
4954
});

0 commit comments

Comments
 (0)