mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-08 12:20:38 -07:00
Fix so shell calls are formatted (#21237)
This commit is contained in:
@@ -240,6 +240,37 @@ describe('ToolConfirmationMessage', () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('should render multiline shell scripts with correct newlines and syntax highlighting (SVG snapshot)', async () => {
|
||||
const confirmationDetails: SerializableConfirmationDetails = {
|
||||
type: 'exec',
|
||||
title: 'Confirm Multiline Script',
|
||||
command: 'echo "hello"\nfor i in 1 2 3; do\n echo $i\ndone',
|
||||
rootCommand: 'echo',
|
||||
rootCommands: ['echo'],
|
||||
};
|
||||
|
||||
const result = renderWithProviders(
|
||||
<ToolConfirmationMessage
|
||||
callId="test-call-id"
|
||||
confirmationDetails={confirmationDetails}
|
||||
config={mockConfig}
|
||||
getPreferredEditor={vi.fn()}
|
||||
availableTerminalHeight={30}
|
||||
terminalWidth={80}
|
||||
/>,
|
||||
);
|
||||
await result.waitUntilReady();
|
||||
|
||||
const output = result.lastFrame();
|
||||
expect(output).toContain('echo "hello"');
|
||||
expect(output).toContain('for i in 1 2 3; do');
|
||||
expect(output).toContain('echo $i');
|
||||
expect(output).toContain('done');
|
||||
|
||||
await expect(result).toMatchSvgSnapshot();
|
||||
result.unmount();
|
||||
});
|
||||
|
||||
describe('with folder trust', () => {
|
||||
const editConfirmationDetails: SerializableConfirmationDetails = {
|
||||
type: 'edit',
|
||||
|
||||
Reference in New Issue
Block a user