Skip to content

Commit 6d50abc

Browse files
authored
Modal exists even when not visible (automation gap - WOAUILIB-3606) (#2907)
* Test automation gap - WOAUILIB-3606
1 parent 6a4666e commit 6d50abc

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/incubator/Dialog/__tests__/index.new.spec.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,26 @@ describe('Incubator.Dialog sanity checks', () => {
8484
});
8585
expect(dialogDriver.getModal().isVisible()).toBeFalsy();
8686
});
87-
it('Should exist only if visible', async () => {
87+
88+
it('Should exist only if visible', () => {
8889
const onDismiss = jest.fn();
8990
const component = <TestCase2 onDismiss={onDismiss}/>;
9091
const {dialogDriver, renderTree} = getDriver(component);
9192
expect(dialogDriver.getModal().isVisible()).toBeFalsy();
9293
const openButtonDriver = ButtonDriver({renderTree, testID: 'openButton'});
9394
openButtonDriver.press();
94-
expect(await dialogDriver.getModal().isVisible()).toBeTruthy();
95+
expect(dialogDriver.getModal().isVisible()).toBeTruthy();
9596
expect(onDismiss).toHaveBeenCalledTimes(0);
9697
const closeButtonDriver = ButtonDriver({renderTree, testID: 'closeButton'});
9798
closeButtonDriver.press();
98-
expect(await dialogDriver.getModal().isVisible()).toBeFalsy();
99+
expect(dialogDriver.getModal().isVisible()).toBeFalsy();
99100
expect(onDismiss).toHaveBeenCalledTimes(1);
100101
});
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+
});
101109
});

0 commit comments

Comments
 (0)