From 5e0f8aab7665435f82f9cf022e8b2c5ff0d6ecd7 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 30 Oct 2026 20:54:00 -0500 Subject: [PATCH] test(ui): wait for task panel activation to settle Co-Authored-By: Paperclip --- ui/src/hooks/useTaskPluginPanels.test.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/hooks/useTaskPluginPanels.test.tsx b/ui/src/hooks/useTaskPluginPanels.test.tsx index c013137a057..bec7ca5b66c 100644 --- a/ui/src/hooks/useTaskPluginPanels.test.tsx +++ b/ui/src/hooks/useTaskPluginPanels.test.tsx @@ -143,9 +143,17 @@ it("discovers a panel started after the task is already open, then hides it on s get.mockRejectedValue(new Error("Access denied")); await refresh(); expect(current).toEqual([]); }); it("clears automatic activation when the run ends even if its view is still ready", async () => { - await render(); expect(current).not.toEqual([]); + await render(); + await vi.waitFor(async () => { + await act(async () => {}); + expect(current).not.toEqual([]); + }); await act(async () => { client.setQueryData(queryKeys.issues.liveRuns("task"), []); }); - await render(); expect(current).toEqual([]); + await render(); + await vi.waitFor(async () => { + await act(async () => {}); + expect(current).toEqual([]); + }); }); it("does not carry an old task's ready panel to a new task or disabled plugin", async () => { await render(); expect(current).not.toEqual([]);