test(gui): pin the row's count-only summary for an unusable active name

The JSDoc correction stated this behavior but nothing asserted it at the
row: when the first in_progress item carries no usable content the row
renders the counts alone rather than the generic tool summary. Reverting
that to a `?? model.summary` fallback turns exactly this case red.
This commit is contained in:
Chinesezjc
2026-07-29 10:16:08 +08:00
parent 889ee40cd3
commit 86c62cf966

View File

@@ -186,6 +186,15 @@ describe('TodoRow', () => {
expect(screen.getByText('1/1 已完成')).toBeTruthy()
})
it('keeps the counts when an active item has unusable content, instead of the generic summary', () => {
// planSummary yields activeContent null here, but the counts are known good,
// so the row drops only the active clause — `?? model.summary` never runs.
const args = JSON.stringify({ todos: [{ content: 'done', status: 'completed' }, { content: 42, status: 'in_progress' }] })
const { container } = render(<TodoRow {...rowProps(resultNode(args))} />)
expect(screen.getByText('1/2 已完成')).toBeTruthy()
expect(container.textContent).not.toContain('+')
})
it('keeps the non-ok execution states visible: running dot, interrupted marker', () => {
// A running call (no result yet) shows the ongoing dot, never the ok badge.
const args = JSON.stringify({ todos: LIST })