From f0724bf2d96cb081f127b6b73ea5e966360a0c3f Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Tue, 14 Jul 2026 18:18:30 -0400 Subject: [PATCH] test(tui): wait for event connection --- packages/tui/test/cli/tui/data.test.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/tui/test/cli/tui/data.test.tsx b/packages/tui/test/cli/tui/data.test.tsx index 444d0bb2ff..53c51d6d14 100644 --- a/packages/tui/test/cli/tui/data.test.tsx +++ b/packages/tui/test/cli/tui/data.test.tsx @@ -764,8 +764,10 @@ test("classifies live tool rows independently of their call ID", async () => { if (url.pathname === `/api/session/${sessionID}/message`) return json({ data: [], cursor: {} }) }, events) let rows!: ReturnType + let client!: ReturnType function Probe() { + client = useClient() rows = createSessionRows(() => sessionID) return } @@ -783,6 +785,7 @@ test("classifies live tool rows independently of their call ID", async () => { )) try { + await wait(() => client.connection.status() === "connected") emitEvent(events, { id: "evt_tool_started", created: 1,