summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
diff options
context:
space:
mode:
authorBilly Biggs <[email protected]>2025-06-21 12:15:43 -0700
committerGitHub <[email protected]>2025-06-21 19:15:43 +0000
commit99a6dc026708d91bb628873a769c615640a2c0ea (patch)
treeafd188378b191f3dca11ae571d9f29095bc6e7b4 /packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
parent03af6235a922c3cf753ce0b1e257830dee5340aa (diff)
Update memory and context summary UI for multiple context filenames (#1282)
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.test.ts')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.test.ts24
1 files changed, 18 insertions, 6 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
index 03f8cc9c..31105509 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
@@ -62,14 +62,15 @@ import {
} from './slashCommandProcessor.js';
import { MessageType } from '../types.js';
import {
- type Config,
- MCPServerStatus,
- getMCPServerStatus,
+ Config,
MCPDiscoveryState,
+ MCPServerStatus,
getMCPDiscoveryState,
+ getMCPServerStatus,
GeminiClient,
} from '@gemini-cli/core';
import { useSessionStats } from '../contexts/SessionContext.js';
+import { LoadedSettings } from '../../config/settings.js';
vi.mock('@gemini-code/core', async (importOriginal) => {
const actual = await importOriginal<typeof import('@gemini-code/core')>();
@@ -161,10 +162,16 @@ describe('useSlashCommandProcessor', () => {
process.env = { ...globalThis.process.env };
});
- const getProcessorHook = (showToolDescriptions: boolean = false) =>
- renderHook(() =>
+ const getProcessorHook = (showToolDescriptions: boolean = false) => {
+ const settings = {
+ merged: {
+ contextFileName: 'GEMINI.md',
+ },
+ } as LoadedSettings;
+ return renderHook(() =>
useSlashCommandProcessor(
mockConfig,
+ settings,
[],
mockAddItem,
mockClearItems,
@@ -181,6 +188,7 @@ describe('useSlashCommandProcessor', () => {
mockSetQuittingMessages,
),
);
+ };
const getProcessor = (showToolDescriptions: boolean = false) =>
getProcessorHook(showToolDescriptions).result.current;
@@ -253,7 +261,11 @@ describe('useSlashCommandProcessor', () => {
});
expect(
ShowMemoryCommandModule.createShowMemoryAction,
- ).toHaveBeenCalledWith(mockConfig, expect.any(Function));
+ ).toHaveBeenCalledWith(
+ mockConfig,
+ expect.any(Object),
+ expect.any(Function),
+ );
expect(mockReturnedShowAction).toHaveBeenCalled();
expect(commandResult).toBe(true);
});