From cfe59307d6f836b9ceb6676564324d50c9265bab Mon Sep 17 00:00:00 2001 From: twwu Date: Mon, 23 Mar 2026 18:32:59 +0800 Subject: [PATCH] test: add setup function and new test for follow-up message handling in useChat hook --- .../workflow/panel/debug-and-preview/__tests__/hooks.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts index 590a00643f..e81620e984 100644 --- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts +++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts @@ -1293,6 +1293,8 @@ describe('useChat – handleResume', () => { mockHandleRun.mockReset() mockSseGet.mockReset() }) + + async function setupResumeWithTree() { let sendCallbacks: any mockHandleRun.mockImplementation((_params: any, callbacks: any) => { sendCallbacks = callbacks @@ -2587,6 +2589,8 @@ describe('useChat – updateCurrentQAOnTree with parent_message_id', () => { capturedCallbacks = callbacks }) }) + + it('should handle follow-up message with parent_message_id', async () => { const { result } = renderHook(() => useChat({})) act(() => {