refactor(cli): simplify keypress and mouse providers and update tests (#22853)

This commit is contained in:
Tommaso Sciortino
2026-03-18 16:38:56 +00:00
committed by GitHub
parent 81a97e78f1
commit d7dfcf7f99
40 changed files with 923 additions and 863 deletions

View File

@@ -5,9 +5,10 @@
*/
import { renderWithProviders } from '../../../test-utils/render.js';
import { createMockSettings } from '../../../test-utils/settings.js';
import { ToolResultDisplay } from './ToolResultDisplay.js';
import { describe, it, expect } from 'vitest';
import { type AnsiOutput } from '@google/gemini-cli-core';
import { makeFakeConfig, type AnsiOutput } from '@google/gemini-cli-core';
describe('ToolResultDisplay Overflow', () => {
it('shows the head of the content when overflowDirection is bottom (string)', async () => {
@@ -20,7 +21,10 @@ describe('ToolResultDisplay Overflow', () => {
overflowDirection="bottom"
/>,
{
useAlternateBuffer: false,
config: makeFakeConfig({ useAlternateBuffer: false }),
settings: createMockSettings({
merged: { ui: { useAlternateBuffer: false } },
}),
uiState: { constrainHeight: true },
},
);
@@ -46,7 +50,10 @@ describe('ToolResultDisplay Overflow', () => {
overflowDirection="top"
/>,
{
useAlternateBuffer: false,
config: makeFakeConfig({ useAlternateBuffer: false }),
settings: createMockSettings({
merged: { ui: { useAlternateBuffer: false } },
}),
uiState: { constrainHeight: true },
},
);
@@ -83,7 +90,10 @@ describe('ToolResultDisplay Overflow', () => {
overflowDirection="bottom"
/>,
{
useAlternateBuffer: false,
config: makeFakeConfig({ useAlternateBuffer: false }),
settings: createMockSettings({
merged: { ui: { useAlternateBuffer: false } },
}),
uiState: { constrainHeight: true },
},
);