11import React from 'react' ;
22import ModalMandatory from './ModalMandatory' ;
33import renderWithProvider from '../../../../util/test/renderWithProvider' ;
4+ import { SafeAreaProvider } from 'react-native-safe-area-context' ;
45const mockedNavigate = jest . fn ( ) ;
56
67jest . mock ( '@react-navigation/native' , ( ) => {
@@ -15,35 +16,39 @@ jest.mock('@react-navigation/native', () => {
1516describe ( '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