From bc25e962330266ce3cf44c032e44f3333ab6cb4b Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 18 Sep 2026 02:22:35 -0700 Subject: [PATCH] test(rpc): use runtime fixture for repo binding --- src/main/runtime/rpc/methods/repo.test.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/runtime/rpc/methods/repo.test.ts b/src/main/runtime/rpc/methods/repo.test.ts index bce3f712e20..f7e98c9bf62 100644 --- a/src/main/runtime/rpc/methods/repo.test.ts +++ b/src/main/runtime/rpc/methods/repo.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import { RpcDispatcher } from '../dispatcher' import type { RpcRequest } from '../core' -import type { OrcaRuntimeService } from '../../orca-runtime' +import { OrcaRuntimeService } from '../../orca-runtime' import { REPO_METHODS } from './repo' import { WORKTREE_VISIBILITY_DEFAULTS_RUNTIME_CAPABILITY } from '../../../../shared/protocol-version' import { REPO_SEARCH_REFS_MAX_LIMIT } from '../../../../shared/repo-search-limits' @@ -390,13 +390,17 @@ describe('repo RPC methods', () => { }) it('persists normalized ghAccount bindings and clear sentinels', async () => { - const runtime = Object.assign(Object.create(null), { - getRuntimeId: () => 'test-runtime', - updateRepo: vi.fn().mockResolvedValue({ - id: 'repo-1', - path: '/srv/repo', - ghAccount: { host: 'github.com', user: 'Alice' } - }) + const runtime = new OrcaRuntimeService(null) + vi.spyOn(runtime, 'getClientSettings').mockReturnValue({ + worktreeVisibilityDefaults: { external: 'hide' } + }) + vi.spyOn(runtime, 'updateRepo').mockResolvedValue({ + id: 'repo-1', + path: '/srv/repo', + displayName: 'repo', + badgeColor: '#000000', + addedAt: 0, + ghAccount: { host: 'github.com', user: 'Alice' } }) const dispatcher = new RpcDispatcher({ runtime, methods: REPO_METHODS })