summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useToolScheduler.test.ts
diff options
context:
space:
mode:
authorN. Taylor Mullen <[email protected]>2025-06-01 14:16:24 -0700
committerGitHub <[email protected]>2025-06-01 14:16:24 -0700
commitf2a8d39f42ae88c1b7a9a5a75854363a53444ca2 (patch)
tree181d8eb3f1b1602f985fba4d2522b06c6c4f2eb6 /packages/cli/src/ui/hooks/useToolScheduler.test.ts
parentedc12e416d0b9daf24ede50cb18b012cb2b6e18a (diff)
refactor: Centralize tool scheduling logic and simplify React hook (#670)
Diffstat (limited to 'packages/cli/src/ui/hooks/useToolScheduler.test.ts')
-rw-r--r--packages/cli/src/ui/hooks/useToolScheduler.test.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/cli/src/ui/hooks/useToolScheduler.test.ts b/packages/cli/src/ui/hooks/useToolScheduler.test.ts
index ebdfed24..92bff2bc 100644
--- a/packages/cli/src/ui/hooks/useToolScheduler.test.ts
+++ b/packages/cli/src/ui/hooks/useToolScheduler.test.ts
@@ -8,12 +8,9 @@
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
import { renderHook, act } from '@testing-library/react';
import {
- useToolScheduler,
- formatLlmContentForFunctionResponse,
+ useReactToolScheduler,
mapToDisplay,
- ToolCall,
- Status as ToolCallStatusType, // Renamed to avoid conflict
-} from './useToolScheduler.js';
+} from './useReactToolScheduler.js';
import {
Part,
PartListUnion,
@@ -29,6 +26,9 @@ import {
ToolCallConfirmationDetails,
ToolConfirmationOutcome,
ToolCallResponseInfo,
+ formatLlmContentForFunctionResponse, // Import from core
+ ToolCall, // Import from core
+ Status as ToolCallStatusType, // Import from core
} from '@gemini-code/core';
import {
HistoryItemWithoutId,
@@ -205,7 +205,7 @@ describe('formatLlmContentForFunctionResponse', () => {
});
});
-describe('useToolScheduler', () => {
+describe('useReactToolScheduler', () => {
// TODO(ntaylormullen): The following tests are skipped due to difficulties in
// reliably testing the asynchronous state updates and interactions with timers.
// These tests involve complex sequences of events, including confirmations,
@@ -276,7 +276,7 @@ describe('useToolScheduler', () => {
const renderScheduler = () =>
renderHook(() =>
- useToolScheduler(
+ useReactToolScheduler(
onComplete,
mockConfig as unknown as Config,
setPendingHistoryItem,
@@ -367,7 +367,7 @@ describe('useToolScheduler', () => {
request,
response: expect.objectContaining({
error: expect.objectContaining({
- message: 'tool nonExistentTool does not exist',
+ message: 'Tool "nonExistentTool" not found in registry.',
}),
}),
}),
@@ -1050,7 +1050,7 @@ describe('mapToDisplay', () => {
},
expectedStatus: ToolCallStatus.Error,
expectedResultDisplay: 'Execution failed display',
- expectedName: baseTool.name,
+ expectedName: baseTool.displayName, // Changed from baseTool.name
expectedDescription: '',
},
{