Skip to content

Commit 3a543ae

Browse files
committed
Update FocusMode tests to handle LG Modal v20
1 parent 0800406 commit 3a543ae

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/compass-aggregations/src/components/focus-mode/focus-mode.spec.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ describe('FocusMode', function () {
1818

1919
it('does not show modal when closed', async function () {
2020
const store = await renderFocusMode();
21-
store.dispatch(disableFocusMode() as any);
22-
await waitFor(() => {
23-
expect(() => {
24-
screen.getByTestId('focus-mode-modal');
25-
}).to.throw();
26-
});
21+
store.dispatch(disableFocusMode());
22+
expect(screen.getByTestId('focus-mode-modal')).to.be.closed;
2723
});
2824

2925
it('shows modal when open', async function () {
@@ -36,14 +32,12 @@ describe('FocusMode', function () {
3632

3733
it('hides modal when close button is clicked', async function () {
3834
const store = await renderFocusMode();
39-
store.dispatch(enableFocusMode(0) as any);
35+
store.dispatch(enableFocusMode(0));
4036

4137
await waitFor(() => {
4238
screen.getByLabelText(/close modal/i).click();
4339
});
4440

45-
await waitFor(() => {
46-
expect(screen.queryByTestId('focus-mode-modal')).to.not.exist;
47-
});
41+
expect(screen.queryByTestId('focus-mode-modal')).to.be.closed;
4842
});
4943
});

0 commit comments

Comments
 (0)