@@ -23,7 +23,7 @@ const BackHandler = RNBackHandler as BackHandlerStatic;
2323describe ( 'Dialog' , ( ) => {
2424 it ( 'should render passed children' , async ( ) => {
2525 await render (
26- < Dialog visible testID = "dialog" overlayTestID = "backdrop" >
26+ < Dialog visible testID = "dialog" >
2727 < Text > This is simple dialog</ Text >
2828 </ Dialog >
2929 ) ;
@@ -36,20 +36,12 @@ describe('Dialog', () => {
3636 it ( 'should call onDismiss when dismissable' , async ( ) => {
3737 const onDismiss = jest . fn ( ) ;
3838 await render (
39- < Dialog
40- visible
41- onDismiss = { onDismiss }
42- dismissable
43- testID = "dialog"
44- overlayTestID = "backdrop"
45- >
39+ < Dialog visible onDismiss = { onDismiss } dismissable testID = "dialog" >
4640 < Text > This is simple dialog</ Text >
4741 </ Dialog >
4842 ) ;
4943
50- await userEvent . press (
51- screen . getByTestId ( 'backdrop' , { includeHiddenElements : true } )
52- ) ;
44+ await userEvent . press ( screen . getByLabelText ( 'Close modal' ) ) ;
5345
5446 await act ( ( ) => {
5547 jest . runAllTimers ( ) ;
@@ -60,20 +52,12 @@ describe('Dialog', () => {
6052 it ( 'should not call onDismiss when dismissable is false' , async ( ) => {
6153 const onDismiss = jest . fn ( ) ;
6254 await render (
63- < Dialog
64- visible
65- onDismiss = { onDismiss }
66- dismissable = { false }
67- testID = "dialog"
68- overlayTestID = "backdrop"
69- >
55+ < Dialog visible onDismiss = { onDismiss } dismissable = { false } testID = "dialog" >
7056 < Text > This is simple dialog</ Text >
7157 </ Dialog >
7258 ) ;
7359
74- await userEvent . press (
75- screen . getByTestId ( 'backdrop' , { includeHiddenElements : true } )
76- ) ;
60+ await userEvent . press ( screen . getByLabelText ( 'Close modal' ) ) ;
7761
7862 await act ( ( ) => {
7963 jest . runAllTimers ( ) ;
@@ -91,15 +75,12 @@ describe('Dialog', () => {
9175 dismissable = { false }
9276 dismissableBackButton
9377 testID = "dialog"
94- overlayTestID = "backdrop"
9578 >
9679 < Text > This is simple dialog</ Text >
9780 </ Dialog >
9881 ) ;
9982
100- await userEvent . press (
101- screen . getByTestId ( 'backdrop' , { includeHiddenElements : true } )
102- ) ;
83+ await userEvent . press ( screen . getByLabelText ( 'Close modal' ) ) ;
10384
10485 await act ( ( ) => {
10586 jest . runAllTimers ( ) ;
0 commit comments