summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.test.tsx')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.test.tsx17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
index 81c7f52b..96dd6aef 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
+++ b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
@@ -15,11 +15,12 @@ import {
TrackedExecutingToolCall,
TrackedCancelledToolCall,
} from './useReactToolScheduler.js';
-import { Config } from '@gemini-cli/core';
+import { Config, EditorType } from '@gemini-cli/core';
import { Part, PartListUnion } from '@google/genai';
import { UseHistoryManagerReturn } from './useHistoryManager.js';
import { HistoryItem } from '../types.js';
import { Dispatch, SetStateAction } from 'react';
+import { LoadedSettings } from '../../config/settings.js';
// --- MOCKS ---
const mockSendMessageStream = vi
@@ -309,6 +310,15 @@ describe('useGeminiStream', () => {
.mockReturnValue((async function* () {})());
});
+ const mockLoadedSettings: LoadedSettings = {
+ merged: { preferredEditor: 'vscode' },
+ user: { path: '/user/settings.json', settings: {} },
+ workspace: { path: '/workspace/.gemini/settings.json', settings: {} },
+ errors: [],
+ forScope: vi.fn(),
+ setValue: vi.fn(),
+ } as unknown as LoadedSettings;
+
const renderTestHook = (
initialToolCalls: TrackedToolCall[] = [],
geminiClient?: any,
@@ -337,6 +347,7 @@ describe('useGeminiStream', () => {
| boolean
>;
shellModeActive: boolean;
+ loadedSettings: LoadedSettings;
}) =>
useGeminiStream(
props.client,
@@ -347,6 +358,7 @@ describe('useGeminiStream', () => {
props.onDebugMessage,
props.handleSlashCommand,
props.shellModeActive,
+ () => 'vscode' as EditorType,
),
{
initialProps: {
@@ -363,6 +375,7 @@ describe('useGeminiStream', () => {
| boolean
>,
shellModeActive: false,
+ loadedSettings: mockLoadedSettings,
},
},
);
@@ -486,6 +499,7 @@ describe('useGeminiStream', () => {
handleSlashCommand:
mockHandleSlashCommand as unknown as typeof mockHandleSlashCommand,
shellModeActive: false,
+ loadedSettings: mockLoadedSettings,
});
});
@@ -541,6 +555,7 @@ describe('useGeminiStream', () => {
handleSlashCommand:
mockHandleSlashCommand as unknown as typeof mockHandleSlashCommand,
shellModeActive: false,
+ loadedSettings: mockLoadedSettings,
});
});