From c322938c97fefe12d63000f92c98906eb80297b0 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sun, 15 Nov 2026 11:36:39 +0000 Subject: [PATCH] test: wait for publish report controls --- .../features/publish/publish-flow.render.test.tsx | 13 +++++++++---- .../publish/publish-progress.render.test.tsx | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/builder/app/builder/features/publish/publish-flow.render.test.tsx b/apps/builder/app/builder/features/publish/publish-flow.render.test.tsx index 50856a4719..0b2bce8074 100644 --- a/apps/builder/app/builder/features/publish/publish-flow.render.test.tsx +++ b/apps/builder/app/builder/features/publish/publish-flow.render.test.tsx @@ -547,10 +547,15 @@ test("an accepted site failure links to its own publish log", async () => { await dispatch.promise; }); const errors = await openErrors("site"); - const showLogs = Array.from( - errors?.querySelectorAll("button") ?? [] - ).find((button) => button.textContent?.trim() === "show logs"); - expect(showLogs).toBeDefined(); + const findShowLogs = () => + Array.from( + errors?.querySelectorAll("button") ?? [] + ).find((button) => button.textContent?.trim() === "show logs"); + await vi.waitFor(async () => { + await act(async () => {}); + expect(findShowLogs()).toBeDefined(); + }); + const showLogs = findShowLogs(); await act(async () => showLogs?.click()); expect( document.body.querySelector('[role="tab"][aria-selected="true"]') diff --git a/apps/builder/app/builder/features/publish/publish-progress.render.test.tsx b/apps/builder/app/builder/features/publish/publish-progress.render.test.tsx index 3c2adf166c..2a526b424b 100644 --- a/apps/builder/app/builder/features/publish/publish-progress.render.test.tsx +++ b/apps/builder/app/builder/features/publish/publish-progress.render.test.tsx @@ -180,7 +180,7 @@ const click = async (label: string) => { const target = button(label); expect(target).toBeDefined(); expect(target?.disabled).toBe(false); - await act(async () => target?.click()); + await act(async () => userEvent.click(target!)); }; const mount = async (projectId = "project") => { await act(async () =>