From 96a09afc3906a4fe9c06acc968aaae9c5242aba0 Mon Sep 17 00:00:00 2001 From: Phelipe Lorran <112786693+httpsphl@users.noreply.github.com> Date: Wed, 30 Sep 2026 11:07:08 -0300 Subject: [PATCH] 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. --- app/src/setup/setup.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/setup/setup.test.tsx b/app/src/setup/setup.test.tsx index 6330cfba..9753d85c 100644 --- a/app/src/setup/setup.test.tsx +++ b/app/src/setup/setup.test.tsx @@ -20,7 +20,8 @@ describe("setup window", () => { const host = await open(); expect(screen.getByRole("heading", { name: "Botloft" })).toBeDefined(); expect(screen.getByText(/without asking for an administrator/)).toBeDefined(); - expect(host.calls).toContain("show"); + // The window is shown in an effect, which may run after the page is found. + await waitFor(() => expect(host.calls).toContain("show")); fireEvent.click(screen.getByRole("button", { name: "Install" })); expect(screen.getByRole("progressbar")).toBeDefined();