@@ -84,18 +84,26 @@ describe('Incubator.Dialog sanity checks', () => {
84
84
} ) ;
85
85
expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeFalsy ( ) ;
86
86
} ) ;
87
- it ( 'Should exist only if visible' , async ( ) => {
87
+
88
+ it ( 'Should exist only if visible' , ( ) => {
88
89
const onDismiss = jest . fn ( ) ;
89
90
const component = < TestCase2 onDismiss = { onDismiss } /> ;
90
91
const { dialogDriver, renderTree} = getDriver ( component ) ;
91
92
expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeFalsy ( ) ;
92
93
const openButtonDriver = ButtonDriver ( { renderTree, testID : 'openButton' } ) ;
93
94
openButtonDriver . press ( ) ;
94
- expect ( await dialogDriver . getModal ( ) . isVisible ( ) ) . toBeTruthy ( ) ;
95
+ expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeTruthy ( ) ;
95
96
expect ( onDismiss ) . toHaveBeenCalledTimes ( 0 ) ;
96
97
const closeButtonDriver = ButtonDriver ( { renderTree, testID : 'closeButton' } ) ;
97
98
closeButtonDriver . press ( ) ;
98
- expect ( await dialogDriver . getModal ( ) . isVisible ( ) ) . toBeFalsy ( ) ;
99
+ expect ( dialogDriver . getModal ( ) . isVisible ( ) ) . toBeFalsy ( ) ;
99
100
expect ( onDismiss ) . toHaveBeenCalledTimes ( 1 ) ;
100
101
} ) ;
102
+
103
+ it ( 'Modal exists even when not visible (WOAUILIB-3606)' , ( ) => {
104
+ const onDismiss = jest . fn ( ) ;
105
+ const component = < TestCase2 onDismiss = { onDismiss } /> ;
106
+ const { dialogDriver} = getDriver ( component ) ;
107
+ expect ( dialogDriver . getModal ( ) . exists ( ) ) . toBeTruthy ( ) ;
108
+ } ) ;
101
109
} ) ;
0 commit comments