mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-12 12:26:57 -07:00
chore: update spinner for /btw
This commit is contained in:
@@ -7,15 +7,8 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { BtwDisplay } from './BtwDisplay.js';
|
||||
import { StreamingState } from '../types.js';
|
||||
import type { UIState } from '../contexts/UIStateContext.js';
|
||||
|
||||
import { Text } from 'ink';
|
||||
|
||||
vi.mock('./GeminiRespondingSpinner.js', () => ({
|
||||
GeminiRespondingSpinner: () => <Text>⠋</Text>,
|
||||
}));
|
||||
|
||||
describe('BtwDisplay', () => {
|
||||
const defaultMockUiState = {
|
||||
renderMarkdown: true,
|
||||
@@ -71,7 +64,7 @@ describe('BtwDisplay', () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('renders a spinner when streaming', async () => {
|
||||
it('renders a spinner and "Answering..." when streaming', async () => {
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<BtwDisplay
|
||||
query="What is life?"
|
||||
@@ -81,14 +74,11 @@ describe('BtwDisplay', () => {
|
||||
terminalWidth={100}
|
||||
/>,
|
||||
{
|
||||
uiState: {
|
||||
...defaultMockUiState,
|
||||
streamingState: StreamingState.Responding,
|
||||
},
|
||||
uiState: defaultMockUiState,
|
||||
},
|
||||
);
|
||||
const frame = lastFrame();
|
||||
expect(frame).toContain('⠋'); // Assuming standard spinner frame
|
||||
expect(frame).toContain('Answering...');
|
||||
unmount();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Box, Text } from 'ink';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import { MarkdownDisplay } from '../utils/MarkdownDisplay.js';
|
||||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { GeminiRespondingSpinner } from './GeminiRespondingSpinner.js';
|
||||
import { CliSpinner } from './CliSpinner.js';
|
||||
|
||||
interface BtwDisplayProps {
|
||||
query: string;
|
||||
@@ -74,7 +74,9 @@ export const BtwDisplay: React.FC<BtwDisplayProps> = ({
|
||||
|
||||
{isStreaming && (
|
||||
<Box marginTop={1}>
|
||||
<GeminiRespondingSpinner />
|
||||
<Text color={theme.text.accent}>
|
||||
<CliSpinner type="dots" /> Answering...
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user