mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-14 08:01:02 -07:00
60 lines
1.4 KiB
TypeScript
60 lines
1.4 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { describe, it, expect } from 'vitest';
|
|
import { render } from '../../../test-utils/render.js';
|
|
import { ThinkingMessage } from './ThinkingMessage.js';
|
|
|
|
describe('ThinkingMessage', () => {
|
|
it('renders thinking subject', () => {
|
|
const { lastFrame } = render(
|
|
<ThinkingMessage
|
|
thought={{ subject: 'Planning', description: 'test' }}
|
|
terminalWidth={80}
|
|
/>,
|
|
);
|
|
|
|
expect(lastFrame()).toContain('Planning');
|
|
});
|
|
|
|
it('renders with thought subject', () => {
|
|
const { lastFrame } = render(
|
|
<ThinkingMessage
|
|
thought={{ subject: 'Processing', description: 'test' }}
|
|
terminalWidth={80}
|
|
/>,
|
|
);
|
|
|
|
expect(lastFrame()).toContain('Processing');
|
|
});
|
|
|
|
it('renders thought content', () => {
|
|
const { lastFrame } = render(
|
|
<ThinkingMessage
|
|
thought={{
|
|
subject: 'Planning',
|
|
description: 'I am planning the solution.',
|
|
}}
|
|
terminalWidth={80}
|
|
/>,
|
|
);
|
|
|
|
expect(lastFrame()).toContain('Planning');
|
|
expect(lastFrame()).toContain('I am planning the solution.');
|
|
});
|
|
|
|
it('renders empty state gracefully', () => {
|
|
const { lastFrame } = render(
|
|
<ThinkingMessage
|
|
thought={{ subject: '', description: '' }}
|
|
terminalWidth={80}
|
|
/>,
|
|
);
|
|
|
|
expect(lastFrame()).not.toContain('Planning');
|
|
});
|
|
});
|