mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-02 05:31:02 +00:00
This commit is contained in:
parent
c33a0da1df
commit
52dae2c583
14 changed files with 524 additions and 135 deletions
|
|
@ -53,14 +53,15 @@ const mockToolRegistry = {
|
|||
const mockConfig = {
|
||||
getToolRegistry: vi.fn(() => mockToolRegistry as unknown as ToolRegistry),
|
||||
getApprovalMode: vi.fn(() => ApprovalMode.DEFAULT),
|
||||
getSessionId: () => 'test-session-id',
|
||||
getUsageStatisticsEnabled: () => true,
|
||||
getDebugMode: () => false,
|
||||
getSessionId: () => 'test-session-id',
|
||||
getAllowedTools: vi.fn(() => []),
|
||||
getContentGeneratorConfig: () => ({
|
||||
model: 'test-model',
|
||||
authType: 'oauth-personal',
|
||||
}),
|
||||
};
|
||||
} as unknown as Config;
|
||||
|
||||
class MockToolInvocation extends BaseToolInvocation<object, ToolResult> {
|
||||
constructor(
|
||||
|
|
@ -218,11 +219,6 @@ describe('useReactToolScheduler in YOLO Mode', () => {
|
|||
await vi.runAllTimersAsync(); // Process execution
|
||||
});
|
||||
|
||||
// Check that shouldConfirmExecute was NOT called
|
||||
expect(
|
||||
mockToolRequiresConfirmation.shouldConfirmExecute,
|
||||
).not.toHaveBeenCalled();
|
||||
|
||||
// Check that execute WAS called
|
||||
expect(mockToolRequiresConfirmation.execute).toHaveBeenCalledWith(
|
||||
request.args,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue