Skip to content

Commit 4cb1ad8

Browse files
test(slack-search): cover reply completing after a failed tool call
1 parent c98f418 commit 4cb1ad8

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎apps/sim/lib/slack-search/assistant-stream.test.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,21 @@ describe('Slack tool progress', () => {
372372
output: { accountLabel: 'private account' },
373373
},
374374
})
375+
await stream.onEvent(toolCall('search_workspace', 'tool-2'))
376+
await stream.onEvent(toolResult('search_workspace', 'tool-2'))
377+
await stream.onEvent({ type: 'text', payload: { channel: 'assistant', text: 'Answer.' } })
378+
await stream.finish(result)
375379
const chunks = deliveredChunks()
376-
expect(chunks[1]).toEqual({ ...chunks[0], status: 'complete' })
380+
const tasks = chunks.filter((chunk) => chunk.type === 'task_update')
381+
expect(tasks.map((chunk) => chunk.status)).toEqual([
382+
'in_progress',
383+
'complete',
384+
'in_progress',
385+
'complete',
386+
])
387+
expect(deliveredText()).toBe('Answer.')
388+
expect(api.stop.mock.calls[0][5]).toEqual([])
389+
expect(api.stop.mock.calls[0][6]).toEqual([])
377390
expect(JSON.stringify(chunks)).not.toContain('private')
378391
})
379392

0 commit comments

Comments
 (0)