The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(conversations): add tests for interrupted answer and processing views
Steven Enamakelfdb5a4923390
diff --git a/app/src/features/conversations/components/InterruptedAnswer.test.tsx b/app/src/features/conversations/components/InterruptedAnswer.test.tsxindex ccd450197a..1a58350f6f 100644--- a/app/src/features/conversations/components/InterruptedAnswer.test.tsx+++ b/app/src/features/conversations/components/InterruptedAnswer.test.tsx@@ -1,4 +1,4 @@-import { render, screen } from '@testing-library/react';+import { fireEvent, render, screen } from '@testing-library/react';import { Provider } from 'react-redux';import { describe, expect, it } from 'vitest';@@ -17,7 +17,13 @@ describe('InterruptedAnswer', () => {const block = screen.getByTestId('interrupted-answer');expect(block.textContent).toContain('Here is the partial answer');- // The reasoning it had streamed is kept in a collapsed block.+ // The reasoning it had streamed is kept in a collapsed reasoning panel+ // (settled, no timing on an interrupted buffer → "Thought").+ const thinking = screen.getByTestId('interrupted-answer-thinking');+ const trigger = thinking.querySelector('button')!;+ expect(trigger.getAttribute('aria-expanded')).toBe('false');+ expect(thinking.querySelector('[data-swap-layer="resting"]')?.textContent).toBe('Thought');+ fireEvent.click(trigger);expect(block.textContent).toContain('was reasoning about it');// Marked interrupted rather than presented as a finished answer.expect(screen.getByTestId('interrupted-answer-marker')).toBeTruthy();diff --git a/app/src/features/conversations/components/ProcessingTranscriptView.test.tsx b/app/src/features/conversations/components/ProcessingTranscriptView.test.tsxindex 9f9183252b..c81b9dc099 100644--- a/app/src/features/conversations/components/ProcessingTranscriptView.test.tsx+++ b/app/src/features/conversations/components/ProcessingTranscriptView.test.tsx@@ -87,12 +87,16 @@ describe('ProcessingTranscriptView live thinking', () => {/>);const live = screen.getByTestId('processing-thinking-live');- expect(live.textContent).toContain('The user wants a week in Kashmir in October.');- // No collapsed <details> row for the same thought.+ // Rendered as a step of the live reasoning panel (its title drops the+ // sentence's closing period).+ expect(live.textContent).toContain('The user wants a week in Kashmir in October');+ expect(live.getAttribute('aria-busy')).toBe('true');+ expect(live.querySelector('[data-shimmer]')).not.toBeNull();+ // No settled row for the same thought.expect(screen.queryByTestId('processing-thinking')).toBeNull();});- it('keeps every thought collapsed once the turn has settled', () => {+ it('renders settled thoughts as a quiet, non-collapsible reasoning panel', () => {render(<ProcessingTranscriptViewtranscript={[thought(0, 'Settled reasoning that should stay quiet.')]}@@ -100,8 +104,28 @@ describe('ProcessingTranscriptView live thinking', () => {/>);expect(screen.queryByTestId('processing-thinking-live')).toBeNull();- const collapsed = screen.getByTestId('processing-thinking') as HTMLDetailsElement;- expect(collapsed.open).toBe(false);+ const settled = screen.getByTestId('processing-thinking');+ // The rail keeps the trail visible: no disclosure, no live shimmer.+ expect(settled.getAttribute('data-variant')).toBe('static');+ expect(settled.querySelector('button')).toBeNull();+ expect(settled.querySelector('[data-shimmer]')).toBeNull();+ expect(settled.textContent).toContain('Settled reasoning that should stay quiet');+ });++ it('labels a settled thought with its recorded duration', () => {+ render(+ <ProcessingTranscriptView+ transcript={[{ ...thought(0, '**Planning**\nok'), startedAt: 1_000, endedAt: 13_000 }]}+ entries={[]}+ />+ );+ const settled = screen.getByTestId('processing-thinking');+ expect(settled.querySelector('[data-swap-layer="resting"]')?.textContent).toBe(+ 'chat.reasoning.thoughtFor'.replace('{n}', '12s')+ );+ expect(settled.querySelector('[data-slot="reasoning-step-title"]')?.textContent).toBe(+ 'Planning'+ );});it('only expands the LAST thought while live; earlier ones stay collapsed', () => {@@ -121,12 +145,13 @@ describe('ProcessingTranscriptView live thinking', () => {expect(screen.getByTestId('processing-thinking-live').textContent).toContain('Second pass');});- it('shows only the tail of a long live thought with a leading ellipsis', () => {+ it('keeps a long live thought whole inside a bounded, bottom-pinned scroll region', () => {const long = 'x'.repeat(2000) + 'TAIL';render(<ProcessingTranscriptView transcript={[thought(0, long)]} entries={[]} live />);const live = screen.getByTestId('processing-thinking-live');- expect(live.textContent).toContain('…');expect(live.textContent).toContain('TAIL');- expect(live.textContent!.length).toBeLessThan(long.length);+ const scroll = live.querySelector('[data-slot="reasoning-panel-scroll"]');+ expect(scroll?.className).toContain('max-h-80');+ expect(scroll?.className).toContain('overflow-y-auto');});});diff --git a/app/src/features/conversations/components/aui/AgentInsightsSlot.test.tsx b/app/src/features/conversations/components/aui/AgentInsightsSlot.test.tsxindex 8a765ad4f6..6171d08c81 100644--- a/app/src/features/conversations/components/aui/AgentInsightsSlot.test.tsx+++ b/app/src/features/conversations/components/aui/AgentInsightsSlot.test.tsx@@ -32,7 +32,7 @@ describe('AgentInsightsSlot before the first tool call', () => {renderSlot({ turnActive: true });expect(screen.getByTestId('agent-insights-live')).toBeTruthy();expect(screen.getByTestId('processing-thinking-live').textContent).toContain(- 'Planning a Kashmir itinerary.'+ 'Planning a Kashmir itinerary');// The whole-run opener stays reachable.expect(screen.getByTestId('view-process-source')).toBeTruthy();