From 9239e52d4b2b03cdab8c6f3b04483f1d7e4d603d Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 3 Jun 2026 20:34:39 -0700 Subject: [PATCH] Update packages/dashboard/app/hooks/__tests__/useChat.test.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- packages/dashboard/app/hooks/__tests__/useChat.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/app/hooks/__tests__/useChat.test.ts b/packages/dashboard/app/hooks/__tests__/useChat.test.ts index 2f0d702dc3..674811c653 100644 --- a/packages/dashboard/app/hooks/__tests__/useChat.test.ts +++ b/packages/dashboard/app/hooks/__tests__/useChat.test.ts @@ -2173,8 +2173,10 @@ describe("useChat", () => { result.current.selectSession("session-001"); }); - await act(async () => { - await new Promise((resolve) => setTimeout(resolve, 25)); + await waitFor(() => { + expect(result.current.pendingMessage).toBe("Queued follow-up"); + expect(mockStreamChatResponse).not.toHaveBeenCalled(); + expect(localStorage.getItem(getChatPendingMessageKey("session-001"))).toBe("Queued follow-up"); }); expect(result.current.pendingMessage).toBe("Queued follow-up");