Skip to content

Commit 96a09af

Browse files
committed
test(setup): wait for the window to be shown
The setup window is shown in an effect, which can run after the test finds the first page. The check failed now and then, locally and in CI.
1 parent 8509d71 commit 96a09af

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎app/src/setup/setup.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ describe("setup window", () => {
2020
const host = await open();
2121
expect(screen.getByRole("heading", { name: "Botloft" })).toBeDefined();
2222
expect(screen.getByText(/without asking for an administrator/)).toBeDefined();
23-
expect(host.calls).toContain("show");
23+
// The window is shown in an effect, which may run after the page is found.
24+
await waitFor(() => expect(host.calls).toContain("show"));
2425

2526
fireEvent.click(screen.getByRole("button", { name: "Install" }));
2627
expect(screen.getByRole("progressbar")).toBeDefined();

0 commit comments

Comments
 (0)