From 0795e55f0e7d2f2822bcd83eaf066eb99c67f858 Mon Sep 17 00:00:00 2001
From: Tolik Malibroda <54813212+tolikmalibroda@users.noreply.github.com>
Date: Mon, 2 Jun 2025 22:05:45 +0200
Subject: feat: Add --yolo mode that automatically accepts all tools executions
 (#695)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
---
 packages/cli/src/ui/App.test.tsx | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

(limited to 'packages/cli/src/ui/App.test.tsx')

diff --git a/packages/cli/src/ui/App.test.tsx b/packages/cli/src/ui/App.test.tsx
index 17d9b459..82c28934 100644
--- a/packages/cli/src/ui/App.test.tsx
+++ b/packages/cli/src/ui/App.test.tsx
@@ -8,7 +8,7 @@ import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
 import { render } from 'ink-testing-library';
 import { App } from './App.js';
 import { Config as ServerConfig, MCPServerConfig } from '@gemini-code/core';
-import type { ToolRegistry } from '@gemini-code/core';
+import { ApprovalMode, ToolRegistry } from '@gemini-code/core';
 import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js';
 
 // Define a more complete mock server config based on actual Config
@@ -28,7 +28,7 @@ interface MockServerConfig {
   userAgent: string;
   userMemory: string;
   geminiMdFileCount: number;
-  alwaysSkipModificationConfirmation: boolean;
+  approvalMode: ApprovalMode;
   vertexai?: boolean;
   showMemoryUsage?: boolean;
 
@@ -50,8 +50,8 @@ interface MockServerConfig {
   setUserMemory: Mock<(newUserMemory: string) => void>;
   getGeminiMdFileCount: Mock<() => number>;
   setGeminiMdFileCount: Mock<(count: number) => void>;
-  getAlwaysSkipModificationConfirmation: Mock<() => boolean>;
-  setAlwaysSkipModificationConfirmation: Mock<(skip: boolean) => void>;
+  getApprovalMode: Mock<() => ApprovalMode>;
+  setApprovalMode: Mock<(skip: ApprovalMode) => void>;
   getVertexAI: Mock<() => boolean | undefined>;
   getShowMemoryUsage: Mock<() => boolean>;
 }
@@ -80,8 +80,7 @@ vi.mock('@gemini-code/core', async (importOriginal) => {
         userAgent: opts.userAgent || 'test-agent',
         userMemory: opts.userMemory || '',
         geminiMdFileCount: opts.geminiMdFileCount || 0,
-        alwaysSkipModificationConfirmation:
-          opts.alwaysSkipModificationConfirmation ?? false,
+        approvalMode: opts.approvalMode ?? ApprovalMode.DEFAULT,
         vertexai: opts.vertexai,
         showMemoryUsage: opts.showMemoryUsage ?? false,
 
@@ -105,10 +104,8 @@ vi.mock('@gemini-code/core', async (importOriginal) => {
         setUserMemory: vi.fn(),
         getGeminiMdFileCount: vi.fn(() => opts.geminiMdFileCount || 0),
         setGeminiMdFileCount: vi.fn(),
-        getAlwaysSkipModificationConfirmation: vi.fn(
-          () => opts.alwaysSkipModificationConfirmation ?? false,
-        ),
-        setAlwaysSkipModificationConfirmation: vi.fn(),
+        getApprovalMode: vi.fn(() => opts.approvalMode ?? ApprovalMode.DEFAULT),
+        setApprovalMode: vi.fn(),
         getVertexAI: vi.fn(() => opts.vertexai),
         getShowMemoryUsage: vi.fn(() => opts.showMemoryUsage ?? false),
       };
-- 
cgit v1.2.3

