mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
Code review cleanup for thinking display (#18720)
This commit is contained in:
@@ -12,7 +12,6 @@ import { StreamingContext } from '../contexts/StreamingContext.js';
|
||||
import { StreamingState } from '../types.js';
|
||||
import { vi } from 'vitest';
|
||||
import * as useTerminalSize from '../hooks/useTerminalSize.js';
|
||||
import * as terminalUtils from '../utils/terminalUtils.js';
|
||||
|
||||
// Mock GeminiRespondingSpinner
|
||||
vi.mock('./GeminiRespondingSpinner.js', () => ({
|
||||
@@ -35,12 +34,7 @@ vi.mock('../hooks/useTerminalSize.js', () => ({
|
||||
useTerminalSize: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('../utils/terminalUtils.js', () => ({
|
||||
shouldUseEmoji: vi.fn(() => true),
|
||||
}));
|
||||
|
||||
const useTerminalSizeMock = vi.mocked(useTerminalSize.useTerminalSize);
|
||||
const shouldUseEmojiMock = vi.mocked(terminalUtils.shouldUseEmoji);
|
||||
|
||||
const renderWithContext = (
|
||||
ui: React.ReactElement,
|
||||
@@ -230,26 +224,6 @@ describe('<LoadingIndicator />', () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('should use ASCII fallback thought indicator when emoji is unavailable', () => {
|
||||
shouldUseEmojiMock.mockReturnValue(false);
|
||||
const props = {
|
||||
thought: {
|
||||
subject: 'Thinking with fallback',
|
||||
description: 'details',
|
||||
},
|
||||
elapsedTime: 5,
|
||||
};
|
||||
const { lastFrame, unmount } = renderWithContext(
|
||||
<LoadingIndicator {...props} />,
|
||||
StreamingState.Responding,
|
||||
);
|
||||
const output = lastFrame();
|
||||
expect(output).toContain('o Thinking with fallback');
|
||||
expect(output).not.toContain('💬');
|
||||
shouldUseEmojiMock.mockReturnValue(true);
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('should prioritize thought.subject over currentLoadingPhrase', () => {
|
||||
const props = {
|
||||
thought: {
|
||||
|
||||
Reference in New Issue
Block a user