Skip to content

Commit bfa9542

Browse files
committed
Use callback instead of reusing saved element
Re-query for the dialog element instead of reusing the prior element as suggested in testing-library/dom-testing-library#1204 (comment)
1 parent 17f7f72 commit bfa9542

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/gui-v2/src/components/ListView.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe("ListView", () => {
5454
await user.click(removedCheckbox);
5555
expect(removedCheckbox.checked).toEqual(false);
5656
await user.click(getByRole(dialog, 'button', { name: 'Apply' }));
57-
await waitForElementToBeRemoved(dialog);
57+
await waitForElementToBeRemoved(() => screen.getByRole('dialog'));
5858
expect(screen.queryByRole('heading', { name: 'Add/remove columns'})).not.toBeInTheDocument();
5959

6060
// Verify that the changes took effect

0 commit comments

Comments
 (0)