@@ -58,16 +58,16 @@ const getDriver = (Element: React.JSX.Element) => {
58
58
describe ( 'Incubator.Dialog sanity checks' , ( ) => {
59
59
it ( 'Should show dialog' , ( ) => {
60
60
const { dialogDriver} = getDriver ( < TestCase1 visible /> ) ;
61
- expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeTruthy ( ) ;
61
+ expect ( dialogDriver . isVisible ( ) ) . toBeTruthy ( ) ;
62
62
} ) ;
63
63
64
64
it ( 'Should dismiss dialog on background press' , ( ) => {
65
65
const dismissFn = jest . fn ( ) ;
66
66
const { dialogDriver} = getDriver ( < TestCase1 visible onDismiss = { dismissFn } /> ) ;
67
67
expect ( dismissFn ) . not . toHaveBeenCalled ( ) ;
68
- expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeTruthy ( ) ;
69
- dialogDriver . getModal ( ) . pressOnBackground ( ) ;
70
- expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeFalsy ( ) ;
68
+ expect ( dialogDriver . isVisible ( ) ) . toBeTruthy ( ) ;
69
+ dialogDriver . pressOnBackground ( ) ;
70
+ expect ( dialogDriver . isVisible ( ) ) . toBeFalsy ( ) ;
71
71
expect ( dismissFn ) . toHaveBeenCalledTimes ( 1 ) ;
72
72
} ) ;
73
73
@@ -78,32 +78,33 @@ describe('Incubator.Dialog sanity checks', () => {
78
78
return < Dialog testID = { testID } visible ref = { dialogRef } /> ;
79
79
} ;
80
80
const { dialogDriver} = getDriver ( < RefTestCase /> ) ;
81
- expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeTruthy ( ) ;
81
+ expect ( dialogDriver . isVisible ( ) ) . toBeTruthy ( ) ;
82
82
act ( ( ) => {
83
83
dialogRef . current ?. dismiss ( ) ;
84
84
} ) ;
85
- expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeFalsy ( ) ;
85
+ expect ( dialogDriver . isVisible ( ) ) . toBeFalsy ( ) ;
86
86
} ) ;
87
87
88
88
it ( 'Should exist only if visible' , ( ) => {
89
89
const onDismiss = jest . fn ( ) ;
90
90
const component = < TestCase2 onDismiss = { onDismiss } /> ;
91
91
const { dialogDriver, renderTree} = getDriver ( component ) ;
92
- expect ( dialogDriver . exists ( ) ) . toBeFalsy ( ) ;
92
+ expect ( dialogDriver . isVisible ( ) ) . toBeFalsy ( ) ;
93
93
const openButtonDriver = ButtonDriver ( { renderTree, testID : 'openButton' } ) ;
94
94
openButtonDriver . press ( ) ;
95
- expect ( dialogDriver . exists ( ) ) . toBeTruthy ( ) ;
95
+ expect ( dialogDriver . isVisible ( ) ) . toBeTruthy ( ) ;
96
96
expect ( onDismiss ) . toHaveBeenCalledTimes ( 0 ) ;
97
97
const closeButtonDriver = ButtonDriver ( { renderTree, testID : 'closeButton' } ) ;
98
98
closeButtonDriver . press ( ) ;
99
- expect ( dialogDriver . exists ( ) ) . toBeFalsy ( ) ;
99
+ expect ( dialogDriver . isVisible ( ) ) . toBeFalsy ( ) ;
100
100
expect ( onDismiss ) . toHaveBeenCalledTimes ( 1 ) ;
101
101
} ) ;
102
102
103
103
it ( 'Modal exists even when not visible (WOAUILIB-3606)' , ( ) => {
104
104
const onDismiss = jest . fn ( ) ;
105
105
const component = < TestCase2 onDismiss = { onDismiss } /> ;
106
106
const { dialogDriver} = getDriver ( component ) ;
107
- expect ( dialogDriver . getModal ( ) . exists ( ) ) . toBeTruthy ( ) ;
107
+ expect ( dialogDriver . exists ( ) ) . toBeTruthy ( ) ;
108
+ expect ( dialogDriver . isVisible ( ) ) . toBeFalsy ( ) ;
108
109
} ) ;
109
110
} ) ;
0 commit comments