From c5f2b8337ade0851faf409478a1b132ad6236ab7 Mon Sep 17 00:00:00 2001 From: altair823 Date: Thu, 7 May 2026 02:32:06 +0900 Subject: [PATCH] =?UTF-8?q?test(v027):=20App/SettingsPage=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20mock=20=EC=9D=84=20=EC=83=88=20AutostartRe?= =?UTF-8?q?sponse=20=ED=98=95=ED=83=9C=EB=A1=9C=20=EA=B0=B1=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/App.test.tsx | 18 ++++++++++++++++-- tests/unit/SettingsPage.test.tsx | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/tests/unit/App.test.tsx b/tests/unit/App.test.tsx index 5e65be9..317e59e 100644 --- a/tests/unit/App.test.tsx +++ b/tests/unit/App.test.tsx @@ -25,8 +25,22 @@ vi.mock('../../src/renderer/inbox/api.js', () => ({ loadOllamaSettings: vi.fn(async () => ({ endpoint: '', model: '' })), saveOllamaSettings: vi.fn(async () => ({ ok: true })), ollamaRecheck: vi.fn(async () => ({ ok: true })), - getAutostart: vi.fn(async () => ({ openAtLogin: false })), - setAutostart: vi.fn(async () => ({ openAtLogin: false })), + getAutostart: vi.fn(async () => ({ + openAtLogin: false, + diagnostic: { + withArgs: { openAtLogin: false, executableWillLaunchAtLogin: false }, + noArgs: { openAtLogin: false, executableWillLaunchAtLogin: false }, + execPath: '/p' + } + })), + setAutostart: vi.fn(async () => ({ + openAtLogin: false, + diagnostic: { + withArgs: { openAtLogin: false, executableWillLaunchAtLogin: false }, + noArgs: { openAtLogin: false, executableWillLaunchAtLogin: false }, + execPath: '/p' + } + })), runBackup: vi.fn(async () => ({ ok: true })), runExport: vi.fn(async () => ({ ok: true })), runImport: vi.fn(async () => ({ ok: true })), diff --git a/tests/unit/SettingsPage.test.tsx b/tests/unit/SettingsPage.test.tsx index 3e0fa48..16081a3 100644 --- a/tests/unit/SettingsPage.test.tsx +++ b/tests/unit/SettingsPage.test.tsx @@ -11,8 +11,22 @@ vi.mock('../../src/renderer/inbox/api.js', () => ({ loadOllamaSettings: vi.fn(async () => null), saveOllamaSettings: vi.fn(async () => ({ ok: true })), ollamaRecheck: vi.fn(async () => ({ ok: true })), - getAutostart: vi.fn(async () => ({ openAtLogin: false })), - setAutostart: vi.fn(async (open: boolean) => ({ openAtLogin: open })), + getAutostart: vi.fn(async () => ({ + openAtLogin: false, + diagnostic: { + withArgs: { openAtLogin: false, executableWillLaunchAtLogin: false }, + noArgs: { openAtLogin: false, executableWillLaunchAtLogin: false }, + execPath: '/p' + } + })), + setAutostart: vi.fn(async (open: boolean) => ({ + openAtLogin: open, + diagnostic: { + withArgs: { openAtLogin: open, executableWillLaunchAtLogin: open }, + noArgs: { openAtLogin: open, executableWillLaunchAtLogin: open }, + execPath: '/p' + } + })), runBackup: vi.fn(async () => ({ ok: true })), runExport: vi.fn(async () => ({ ok: true })), runImport: vi.fn(async () => ({ ok: true })),