diff --git a/mobile/src/new-workspace/creation/created-worktree-setup-review.test.ts b/mobile/src/new-workspace/creation/created-worktree-setup-review.test.ts deleted file mode 100644 index 1c8c5bc3c63..00000000000 --- a/mobile/src/new-workspace/creation/created-worktree-setup-review.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes' -import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' -import { WORKTREE_RUN_APPROVED_SETUP_RUNTIME_CAPABILITY } from '../../../../src/shared/remote-runtime/protocol/worktree-runtime-capabilities' -import { runReviewedCreatedSetup } from './created-worktree-setup-review' -import { createWorktreeWithNameRetry } from './worktree-create-retry' - -function reply(result: unknown): RpcResponse { - return { id: 'rpc-1', ok: true, result, _meta: { runtimeId: 'runtime-1' } } -} - -describe('created workspace setup review', () => { - it('reports setup the host skipped because the created branch differs', async () => { - const client = new FakeSession('connected') - client.sendRequest.mockResolvedValue( - reply({ - worktree: { id: 'wt-1', displayName: 'marlin' }, - setupTrustMismatch: { contentHash: 'branch-hash', scriptContent: 'make branch' } - }) - ) - const result = await createWorktreeWithNameRetry({ - client, - baseName: 'marlin', - worktreeCreateIdempotency: Promise.resolve(false), - approvedSetupHash: 'shown-hash', - buildParams: (name) => ({ repo: 'id:repo-1', name, setupDecision: 'run' }) - }) - expect(client.sendRequest.mock.calls[0]?.[1]).toMatchObject({ approvedSetupHash: 'shown-hash' }) - expect(result).toMatchObject({ - worktreeId: 'wt-1', - setupTrustMismatch: { contentHash: 'branch-hash', scriptContent: 'make branch' } - }) - }) - - it('runs only the reviewed content in the created workspace', async () => { - const client = new FakeSession('connected') - client.sendRequest.mockImplementation(async (method: string) => - method === 'status.get' - ? reply({ capabilities: [WORKTREE_RUN_APPROVED_SETUP_RUNTIME_CAPABILITY] }) - : reply({ status: 'started' }) - ) - await expect(runReviewedCreatedSetup(client, 'wt-1', 'branch-hash')).resolves.toBeUndefined() - expect(client.sendRequest).toHaveBeenCalledWith('worktree.runApprovedSetup', { - worktree: 'id:wt-1', - approvedSetupHash: 'branch-hash' - }) - }) -}) diff --git a/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts b/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts index 706afe57666..49c5d12bbe6 100644 --- a/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts +++ b/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts @@ -78,22 +78,5 @@ export function registerPtyInventoryLivenessVerdictTests(): void { reason: 'relay disconnected during stop' }) }) - - it('does not let a partial inventory overwrite a concurrent provider failure', async () => { - const inventory = deferred<{ id: string; worktreeId: string }[]>() - const listProcesses = vi.fn(() => inventory.promise) - const runtime = await makeRuntimeMissingFromInventory(() => false, listProcesses) - - const listing = runtime.listTerminals(`id:${WORKTREE_ID}`) - await vi.waitFor(() => expect(listProcesses).toHaveBeenCalled()) - runtime.markPtyLivenessUnverifiable(REMOTE_PTY_ID, 'inventory transport failed') - inventory.resolve([]) - await listing - - expect(runtime.getPtyLivenessVerdict(REMOTE_PTY_ID)).toEqual({ - status: 'unverifiable', - reason: 'inventory transport failed' - }) - }) }) }