fix(test): adapt useGeminiStream and config tests to latest main interfaces

This commit is contained in:
Spencer
2026-03-20 05:03:06 +00:00
parent bf6804d9ed
commit 1da234f68c
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1472,7 +1472,7 @@ describe('Approval mode tool exclusion logic', () => {
await expect(
loadCliConfig(settings, 'test-session', invalidArgv as CliArgs),
).rejects.toThrow(
'Invalid approval mode: invalid_mode. Valid values are: auto_edit, plan, default ',
'Invalid approval mode: invalid_mode. Valid values are: auto_edit, plan, default',
);
});
@@ -106,7 +106,12 @@ const MockedGeminiClientClass = vi.hoisted(() =>
);
const MockedUserPromptEvent = vi.hoisted(() =>
vi.fn().mockImplementation(() => {}),
vi
.fn()
.mockImplementation(() => ({
toLogBody: vi.fn(),
toOpenTelemetryAttributes: vi.fn(),
})),
);
const mockParseAndFormatApiError = vi.hoisted(() => vi.fn());
const mockIsBackgroundExecutionData = vi.hoisted(
@@ -2323,7 +2328,6 @@ describe('useGeminiStream', () => {
});
describe('handleApprovalModeChange', () => {
it('should only auto-approve edit tools when switching to AUTO_EDIT mode', async () => {
const awaitingApprovalToolCalls: TrackedToolCall[] = [
createMockToolCall('replace', 'call1', 'edit'),