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 <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-04-30 18:03:54 -04:00
co-authored by Orca
parent e7d1bdaddd
commit d751bd8a63
2 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -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'
@@ -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({