From 85446fdfd30c3f91fe094604b5faa17ae004ba29 Mon Sep 17 00:00:00 2001 From: Mark McLaughlin Date: Tue, 10 Feb 2026 12:00:13 -0800 Subject: [PATCH] refactor: Update Card tests to use renderWithProviders and add new card states --- .../src/ui/components/shared/Card.test.tsx | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/ui/components/shared/Card.test.tsx b/packages/cli/src/ui/components/shared/Card.test.tsx index 345ee3bbab..14e37a2ba0 100644 --- a/packages/cli/src/ui/components/shared/Card.test.tsx +++ b/packages/cli/src/ui/components/shared/Card.test.tsx @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { render } from '../../../test-utils/render.js'; +import { renderWithProviders } from '../../../test-utils/render.js'; import { Card } from './Card.js'; import { Text } from 'ink'; import { describe, it, expect, afterEach, vi } from 'vitest'; -import { ToolCallStatus } from '../../types.js'; +import { ToolCallStatus, StreamingState } from '../../types.js'; describe('Card', () => { afterEach(() => { @@ -51,6 +51,20 @@ describe('Card', () => { showStatusIndicator: true, body: 'Listed 39 item(s).', }, + { + status: ToolCallStatus.Executing, + title: 'Searching', + suffix: 'ripgrep', + showStatusIndicator: true, + body: 'Searching for pattern in directory...', + }, + { + status: ToolCallStatus.Pending, + title: 'No Status Indicator', + suffix: 'Hidden', + showStatusIndicator: false, + body: 'The status indicator should be hidden.', + }, { status: ToolCallStatus.Pending, title: 'Fixed Width Card', @@ -62,7 +76,7 @@ describe('Card', () => { ] as const)( "renders '$title' card with status=$status and showStatusIndicator=$showStatusIndicator", ({ status, title, suffix, showStatusIndicator, body, width }) => { - const { lastFrame } = render( + const { lastFrame } = renderWithProviders( { > {body} , + { + uiState: { + streamingState: StreamingState.Responding, + }, + }, ); const output = lastFrame();