Files
gemini-cli/packages/cli/src/ui/components/messages/ThinkingMessage.test.tsx

60 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-12-31 15:00:35 -05:00
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { render } from '../../../test-utils/render.js';
2025-12-31 15:00:35 -05:00
import { ThinkingMessage } from './ThinkingMessage.js';
describe('ThinkingMessage', () => {
2026-01-31 11:35:59 -05:00
it('renders thinking subject', () => {
2025-12-31 15:00:35 -05:00
const { lastFrame } = render(
<ThinkingMessage
thought={{ subject: 'Planning', description: 'test' }}
2025-12-31 15:00:35 -05:00
terminalWidth={80}
/>,
);
2026-01-31 11:35:59 -05:00
expect(lastFrame()).toContain('Planning');
2025-12-31 15:00:35 -05:00
});
it('renders with thought subject', () => {
2025-12-31 15:00:35 -05:00
const { lastFrame } = render(
<ThinkingMessage
thought={{ subject: 'Processing', description: 'test' }}
2025-12-31 15:00:35 -05:00
terminalWidth={80}
/>,
);
expect(lastFrame()).toContain('Processing');
2025-12-31 15:00:35 -05:00
});
2026-01-03 19:00:15 -05:00
it('renders thought content', () => {
const { lastFrame } = render(
<ThinkingMessage
thought={{
subject: 'Planning',
description: 'I am planning the solution.',
}}
2026-01-03 19:00:15 -05:00
terminalWidth={80}
/>,
);
expect(lastFrame()).toContain('Planning');
expect(lastFrame()).toContain('I am planning the solution.');
});
2025-12-31 15:00:35 -05:00
it('renders empty state gracefully', () => {
const { lastFrame } = render(
<ThinkingMessage
thought={{ subject: '', description: '' }}
terminalWidth={80}
/>,
2025-12-31 15:00:35 -05:00
);
2026-01-31 11:35:59 -05:00
expect(lastFrame()).not.toContain('Planning');
2025-12-31 15:00:35 -05:00
});
});