mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
feat: Add support for MCP Resources (#13178)
Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
This commit is contained in:
@@ -49,6 +49,9 @@ describe('useAtCompletion', () => {
|
||||
})),
|
||||
getEnableRecursiveFileSearch: () => true,
|
||||
getFileFilteringDisableFuzzySearch: () => false,
|
||||
getResourceRegistry: vi.fn().mockReturnValue({
|
||||
getAllResources: () => [],
|
||||
}),
|
||||
} as unknown as Config;
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
@@ -174,6 +177,34 @@ describe('useAtCompletion', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('MCP resource suggestions', () => {
|
||||
it('should include MCP resources in the suggestion list using fuzzy matching', async () => {
|
||||
mockConfig.getResourceRegistry = vi.fn().mockReturnValue({
|
||||
getAllResources: () => [
|
||||
{
|
||||
serverName: 'server-1',
|
||||
uri: 'file:///tmp/server-1/logs.txt',
|
||||
name: 'logs',
|
||||
discoveredAt: Date.now(),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const { result } = renderHook(() =>
|
||||
useTestHarnessForAtCompletion(true, 'logs', mockConfig, '/tmp'),
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
result.current.suggestions.some(
|
||||
(suggestion) =>
|
||||
suggestion.value === 'server-1:file:///tmp/server-1/logs.txt',
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('UI State and Loading Behavior', () => {
|
||||
it('should be in a loading state during initial file system crawl', async () => {
|
||||
testRootDir = await createTmpDir({});
|
||||
|
||||
Reference in New Issue
Block a user