mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 17:11:04 -07:00
feat(cli): truncate shell output in UI history and improve active shell display (#17438)
This commit is contained in:
@@ -65,7 +65,6 @@ vi.mock('node:os', async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
vi.mock('node:crypto');
|
||||
vi.mock('../utils/textUtils.js');
|
||||
|
||||
import {
|
||||
useShellCommandProcessor,
|
||||
|
||||
@@ -245,5 +245,34 @@ describe('toolMapping', () => {
|
||||
expect(displayTool.status).toBe(ToolCallStatus.Canceled);
|
||||
expect(displayTool.resultDisplay).toBe('User cancelled');
|
||||
});
|
||||
|
||||
it('propagates borderTop and borderBottom options correctly', () => {
|
||||
const toolCall: ScheduledToolCall = {
|
||||
status: 'scheduled',
|
||||
request: mockRequest,
|
||||
tool: mockTool,
|
||||
invocation: mockInvocation,
|
||||
};
|
||||
|
||||
const result = mapToDisplay(toolCall, {
|
||||
borderTop: true,
|
||||
borderBottom: false,
|
||||
});
|
||||
expect(result.borderTop).toBe(true);
|
||||
expect(result.borderBottom).toBe(false);
|
||||
});
|
||||
|
||||
it('sets resultDisplay to undefined for pre-execution statuses', () => {
|
||||
const toolCall: ScheduledToolCall = {
|
||||
status: 'scheduled',
|
||||
request: mockRequest,
|
||||
tool: mockTool,
|
||||
invocation: mockInvocation,
|
||||
};
|
||||
|
||||
const result = mapToDisplay(toolCall);
|
||||
expect(result.tools[0].resultDisplay).toBeUndefined();
|
||||
expect(result.tools[0].status).toBe(ToolCallStatus.Pending);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user