Просмотр исходного кода

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.
Chinesezjc 2 месяцев назад
Родитель
Сommit
86c62cf966
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      packages/client/ui-conversation/tests/todo-panel.spec.tsx

+ 9 - 0
packages/client/ui-conversation/tests/todo-panel.spec.tsx

@@ -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 })