mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-02 02:01:47 +00:00
test(tui): cover live todo completion flow
This commit is contained in:
parent
f5552f92e2
commit
a5319fb7af
2 changed files with 14 additions and 2 deletions
|
|
@ -80,6 +80,18 @@ describe('createGatewayEventHandler', () => {
|
|||
expect(getTurnState().todos).toEqual(todos)
|
||||
})
|
||||
|
||||
it('archives completed todos into transcript flow at end of turn', () => {
|
||||
const appended: Msg[] = []
|
||||
const todos = [{ content: 'Serve tiny latte', id: 'serve', status: 'completed' }]
|
||||
const onEvent = createGatewayEventHandler(buildCtx(appended))
|
||||
|
||||
onEvent({ payload: { name: 'todo', todos, tool_id: 'todo-1' }, type: 'tool.start' } as any)
|
||||
onEvent({ payload: { text: 'done' }, type: 'message.complete' } as any)
|
||||
|
||||
expect(getTurnState().todos).toEqual([])
|
||||
expect(appended).toContainEqual({ kind: 'trail', role: 'system', text: '', todos })
|
||||
})
|
||||
|
||||
it('keeps the current todo list visible when the next message starts', () => {
|
||||
const appended: Msg[] = []
|
||||
const todos = [{ content: 'Boil water', id: 'boil', status: 'in_progress' }]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue