test: add setup function and new test for follow-up message handling in useChat hook

This commit is contained in:
twwu 2026-03-23 18:32:59 +08:00
parent cc4544ebbd
commit cfe59307d6
1 changed files with 4 additions and 0 deletions

View File

@ -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(() => {