Skip to content

Commit

Permalink
Use callback instead of reusing saved element
Browse files Browse the repository at this point in the history
Re-query for the dialog element instead of reusing the prior element as
suggested in testing-library/dom-testing-library#1204 (comment)
  • Loading branch information
brianlove committed Oct 20, 2023
1 parent 3ea3423 commit 9cfb63c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/gui-v2/src/components/ListView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("ListView", () => {
await user.click(removedCheckbox);
expect(removedCheckbox.checked).toEqual(false);
await user.click(getByRole(dialog, 'button', { name: 'Apply' }));
await waitForElementToBeRemoved(dialog);
await waitForElementToBeRemoved(() => screen.getByRole('dialog'));
expect(screen.queryByRole('heading', { name: 'Add/remove columns'})).not.toBeInTheDocument();

// Verify that the changes took effect
Expand Down

0 comments on commit 9cfb63c

Please sign in to comment.