mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-14 09:11:54 +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' }]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
|
|||
import { liveTailOrder } from './liveLayout.js'
|
||||
|
||||
describe('liveTailOrder', () => {
|
||||
it('keeps todo before transcript and assistant live output', () => {
|
||||
expect(liveTailOrder()).toEqual(['todo', 'scroll-history', 'assistant'])
|
||||
it('anchors live todo after scroll history and assistant output', () => {
|
||||
expect(liveTailOrder()).toEqual(['scroll-history', 'assistant', 'live-todo'])
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue