From 98fb26073c1d3237ec2da809d635c9cd92c57c5a Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Wed, 18 Nov 2026 01:31:41 +0000 Subject: [PATCH] test(ui-kit): wait for the deferred tail in the frame-refusals case (#4250) #4240 re-parses the growing last markdown block at deferred priority, so the delta appended inside flushSync shows on the next commit. The frame-refusals visual case read the reply straight after it; it now polls for the appended text. Co-Authored-By: Claude Opus 5.5 --- packages/ui-kit/tests/visual/connection-refusals.visual.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ui-kit/tests/visual/connection-refusals.visual.tsx b/packages/ui-kit/tests/visual/connection-refusals.visual.tsx index 65491a9aa1..40c1faca36 100644 --- a/packages/ui-kit/tests/visual/connection-refusals.visual.tsx +++ b/packages/ui-kit/tests/visual/connection-refusals.visual.tsx @@ -64,7 +64,9 @@ for (const theme of ["dark", "light"]) { ui.connection.handleServerMessage({ type: "text_delta", sessionId: SESSION, turnId: "active", text: " Still sailing." }); ui.connection.flushChatDeltas(); }); - expect(container.textContent).toContain(PARTIAL + " Still sailing."); + // The growing last block re-parses at deferred priority (#2588), so + // the appended text shows on the commit after the urgent one. + await expect.poll(() => container.textContent).toContain(PARTIAL + " Still sailing."); flushSync(() => ui.connection.handleServerMessage({ type: "error", code: "agent_error", sessionId: SESSION, turnId: "active", message: "Provider unavailable",