From d751bd8a63162eb51b44ae760cd56f7aa8564358 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Wed, 29 Apr 2026 14:35:44 -0400 Subject: [PATCH] fix: repair test failures from mobile feature additions - Add shouldRunSetupForCreate to hooks mock in orca-runtime tests - Fix send() helper to use rest args, avoiding extra undefined in IPC calls Co-authored-by: Orca --- src/main/runtime/orca-runtime.test.ts | 11 +++++++++-- src/main/window/attach-main-window-services.ts | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/runtime/orca-runtime.test.ts b/src/main/runtime/orca-runtime.test.ts index 649fd9cb3d2..0dabb949ccf 100644 --- a/src/main/runtime/orca-runtime.test.ts +++ b/src/main/runtime/orca-runtime.test.ts @@ -2,7 +2,12 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { WorktreeMeta } from '../../shared/types' import { addWorktree, listWorktrees, removeWorktree } from '../git/worktree' -import { createSetupRunnerScript, getEffectiveHooks, runHook } from '../hooks' +import { + createSetupRunnerScript, + getEffectiveHooks, + runHook, + shouldRunSetupForCreate +} from '../hooks' import { OrchestrationDb } from './orchestration/db' import { OrcaRuntimeService } from './orca-runtime' @@ -39,7 +44,8 @@ vi.mock('../git/worktree', () => ({ vi.mock('../hooks', () => ({ createSetupRunnerScript: vi.fn(), getEffectiveHooks: vi.fn().mockReturnValue(null), - runHook: vi.fn().mockResolvedValue({ success: true, output: '' }) + runHook: vi.fn().mockResolvedValue({ success: true, output: '' }), + shouldRunSetupForCreate: vi.fn().mockReturnValue(false) })) vi.mock('../ipc/worktree-logic', async (importOriginal) => { @@ -1320,6 +1326,7 @@ describe('OrcaRuntimeService', () => { computeWorktreePathMock.mockReturnValue('/tmp/workspaces/runtime-hook-test') ensurePathWithinWorkspaceMock.mockReturnValue('/tmp/workspaces/runtime-hook-test') + vi.mocked(shouldRunSetupForCreate).mockReturnValue(true) vi.mocked(getEffectiveHooks).mockReturnValue({ scripts: { setup: 'pnpm worktree:setup' diff --git a/src/main/window/attach-main-window-services.ts b/src/main/window/attach-main-window-services.ts index d69643652b0..03735d3ddee 100644 --- a/src/main/window/attach-main-window-services.ts +++ b/src/main/window/attach-main-window-services.ts @@ -200,9 +200,9 @@ function registerRuntimeWindowLifecycle( runtime: OrcaRuntimeService ): void { runtime.attachWindow(mainWindow.id) - const send = (channel: string, data?: unknown): void => { + const send = (channel: string, ...args: unknown[]): void => { if (!mainWindow.isDestroyed()) { - mainWindow.webContents.send(channel, data) + mainWindow.webContents.send(channel, ...args) } } runtime.setNotifier({