mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-06 03:10:42 -07:00
extract console error to util func (#11675)
This commit is contained in:
@@ -224,37 +224,11 @@ const TOOLS_SHELL_FAKE_SCHEMA: SettingsSchemaType = {
|
||||
},
|
||||
} as unknown as SettingsSchemaType;
|
||||
|
||||
// Helper function to simulate key presses (commented out for now)
|
||||
// const simulateKeyPress = async (keyData: Partial<Key> & { name: string }) => {
|
||||
// if (currentKeypressHandler) {
|
||||
// const key: Key = {
|
||||
// ctrl: false,
|
||||
// meta: false,
|
||||
// shift: false,
|
||||
// paste: false,
|
||||
// sequence: keyData.sequence || keyData.name,
|
||||
// ...keyData,
|
||||
// };
|
||||
// currentKeypressHandler(key);
|
||||
// // Allow React to process the state update
|
||||
// await new Promise(resolve => setTimeout(resolve, 10));
|
||||
// }
|
||||
// };
|
||||
|
||||
// Mock console.log to avoid noise in tests
|
||||
// const originalConsoleLog = console.log;
|
||||
// const originalConsoleError = console.error;
|
||||
|
||||
describe('SettingsDialog', () => {
|
||||
// Simple delay function for remaining tests that need gradual migration
|
||||
const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
beforeEach(() => {
|
||||
// Reset keypress mock state (variables are commented out)
|
||||
// currentKeypressHandler = null;
|
||||
// isKeypressActive = false;
|
||||
// console.log = vi.fn();
|
||||
// console.error = vi.fn();
|
||||
mockToggleVimEnabled.mockResolvedValue(true);
|
||||
});
|
||||
|
||||
@@ -262,11 +236,6 @@ describe('SettingsDialog', () => {
|
||||
TEST_ONLY.clearFlattenedSchema();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
// Reset keypress mock state (variables are commented out)
|
||||
// currentKeypressHandler = null;
|
||||
// isKeypressActive = false;
|
||||
// console.log = originalConsoleLog;
|
||||
// console.error = originalConsoleError;
|
||||
});
|
||||
|
||||
describe('Initial Rendering', () => {
|
||||
|
||||
Reference in New Issue
Block a user