mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
Protect stdout and stderr so JavaScript code can't accidentally write to stdout corrupting ink rendering (#13247)
Bypassing rules as link checker failure is spurious.
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
type Mock,
|
||||
} from 'vitest';
|
||||
import { act, useEffect } from 'react';
|
||||
import { render } from '../../test-utils/render.js';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { waitFor } from '../../test-utils/async.js';
|
||||
import { useCommandCompletion } from './useCommandCompletion.js';
|
||||
import type { CommandContext } from '../commands/types.js';
|
||||
@@ -132,7 +132,7 @@ describe('useCommandCompletion', () => {
|
||||
hookResult = { ...completion, textBuffer };
|
||||
return null;
|
||||
}
|
||||
render(<TestComponent />);
|
||||
renderWithProviders(<TestComponent />);
|
||||
return {
|
||||
result: {
|
||||
get current() {
|
||||
@@ -516,7 +516,7 @@ describe('useCommandCompletion', () => {
|
||||
hookResult = { ...completion, textBuffer };
|
||||
return null;
|
||||
}
|
||||
render(<TestComponent />);
|
||||
renderWithProviders(<TestComponent />);
|
||||
|
||||
// Should not trigger prompt completion for comments
|
||||
expect(hookResult!.suggestions.length).toBe(0);
|
||||
@@ -549,7 +549,7 @@ describe('useCommandCompletion', () => {
|
||||
hookResult = { ...completion, textBuffer };
|
||||
return null;
|
||||
}
|
||||
render(<TestComponent />);
|
||||
renderWithProviders(<TestComponent />);
|
||||
|
||||
// Should not trigger prompt completion for comments
|
||||
expect(hookResult!.suggestions.length).toBe(0);
|
||||
@@ -582,7 +582,7 @@ describe('useCommandCompletion', () => {
|
||||
hookResult = { ...completion, textBuffer };
|
||||
return null;
|
||||
}
|
||||
render(<TestComponent />);
|
||||
renderWithProviders(<TestComponent />);
|
||||
|
||||
// This test verifies that comments are filtered out while regular text is not
|
||||
expect(hookResult!.textBuffer.text).toBe(
|
||||
|
||||
Reference in New Issue
Block a user