mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2025 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { describe, it, expect } from 'vitest';
|
||
|
|
import { render } from 'ink-testing-library';
|
||
|
|
import { ThinkingMessage } from './ThinkingMessage.js';
|
||
|
|
|
||
|
|
describe('ThinkingMessage', () => {
|
||
|
|
it('renders thinking header with count', () => {
|
||
|
|
const { lastFrame } = render(
|
||
|
|
<ThinkingMessage
|
||
|
|
thoughts={[
|
||
|
|
{ subject: 'Planning', description: 'test' },
|
||
|
|
{ subject: 'Analyzing', description: 'test' },
|
||
|
|
]}
|
||
|
|
terminalWidth={80}
|
||
|
|
/>,
|
||
|
|
);
|
||
|
|
|
||
|
|
expect(lastFrame()).toContain('Thinking');
|
||
|
|
expect(lastFrame()).toContain('(2)');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('renders with single thought', () => {
|
||
|
|
const { lastFrame } = render(
|
||
|
|
<ThinkingMessage
|
||
|
|
thoughts={[{ subject: 'Processing', description: 'test' }]}
|
||
|
|
terminalWidth={80}
|
||
|
|
/>,
|
||
|
|
);
|
||
|
|
|
||
|
|
expect(lastFrame()).toContain('(1)');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('renders empty state gracefully', () => {
|
||
|
|
const { lastFrame } = render(
|
||
|
|
<ThinkingMessage thoughts={[]} terminalWidth={80} />,
|
||
|
|
);
|
||
|
|
|
||
|
|
expect(lastFrame()).toContain('(0)');
|
||
|
|
});
|
||
|
|
});
|