mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-08 04:10:35 -07:00
refactor(cli): simplify keypress and mouse providers and update tests (#22853)
This commit is contained in:
committed by
GitHub
parent
81a97e78f1
commit
d7dfcf7f99
@@ -6,10 +6,11 @@
|
||||
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { getToolGroupBorderAppearance } from './borderStyles.js';
|
||||
import { CoreToolCallStatus } from '@google/gemini-cli-core';
|
||||
import { CoreToolCallStatus, makeFakeConfig } from '@google/gemini-cli-core';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import type { IndividualToolCallDisplay } from '../types.js';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { createMockSettings } from '../../test-utils/settings.js';
|
||||
import { MainContent } from '../components/MainContent.js';
|
||||
import { Text } from 'ink';
|
||||
|
||||
@@ -17,6 +18,13 @@ vi.mock('../components/CliSpinner.js', () => ({
|
||||
CliSpinner: () => <Text>⊶</Text>,
|
||||
}));
|
||||
|
||||
const altBufferOptions = {
|
||||
config: makeFakeConfig({ useAlternateBuffer: true }),
|
||||
settings: createMockSettings({
|
||||
merged: { ui: { useAlternateBuffer: true } },
|
||||
}),
|
||||
};
|
||||
|
||||
describe('getToolGroupBorderAppearance', () => {
|
||||
it('should use warning color for pending non-shell tools', () => {
|
||||
const item = {
|
||||
@@ -105,6 +113,7 @@ describe('getToolGroupBorderAppearance', () => {
|
||||
describe('MainContent tool group border SVG snapshots', () => {
|
||||
it('should render SVG snapshot for a pending search dialog (google_web_search)', async () => {
|
||||
const renderResult = renderWithProviders(<MainContent />, {
|
||||
...altBufferOptions,
|
||||
uiState: {
|
||||
history: [],
|
||||
pendingHistoryItems: [
|
||||
@@ -129,6 +138,7 @@ describe('MainContent tool group border SVG snapshots', () => {
|
||||
|
||||
it('should render SVG snapshot for an empty slice following a search tool', async () => {
|
||||
const renderResult = renderWithProviders(<MainContent />, {
|
||||
...altBufferOptions,
|
||||
uiState: {
|
||||
history: [],
|
||||
pendingHistoryItems: [
|
||||
@@ -157,6 +167,7 @@ describe('MainContent tool group border SVG snapshots', () => {
|
||||
|
||||
it('should render SVG snapshot for a shell tool', async () => {
|
||||
const renderResult = renderWithProviders(<MainContent />, {
|
||||
...altBufferOptions,
|
||||
uiState: {
|
||||
history: [],
|
||||
pendingHistoryItems: [
|
||||
|
||||
Reference in New Issue
Block a user