From c8ffc9dc4d6eb6731041e23dc172163e55682e04 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 14 Sep 2026 21:55:03 -0700 Subject: [PATCH] test(git): expect propagated verdicts when SSH relay fails Updates test expectations to verify that SSH relay and provider failures are propagated as unverifiable verdicts rather than silently returning empty results. Aligns with recent fixes to propagate base ref search failures instead of swallowing them. --- .../ipc/repos-remote-base-ref-queries.test.ts | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/ipc/repos-remote-base-ref-queries.test.ts b/src/main/ipc/repos-remote-base-ref-queries.test.ts index f4a43633712..de9312abc70 100644 --- a/src/main/ipc/repos-remote-base-ref-queries.test.ts +++ b/src/main/ipc/repos-remote-base-ref-queries.test.ts @@ -504,7 +504,7 @@ describe('repos:searchBaseRefs SSH relay', () => { expect(result).not.toContain('upstream/HEAD') }) - it('returns [] when the relay exec throws', async () => { + it('propagates an unverifiable verdict when the relay exec throws', async () => { mockGitProvider.exec = vi.fn().mockRejectedValue(new Error('ssh connection dropped')) mockStore.getRepo.mockReturnValue({ @@ -514,16 +514,15 @@ describe('repos:searchBaseRefs SSH relay', () => { kind: 'git' }) - const result = await handlers.get('repos:searchBaseRefs')!(null, { - repoId: 'r1', - query: 'main' - }) - - // Why: transport failure falls back to an empty result set so the picker doesn't crash. - expect(result).toEqual([]) + await expect( + handlers.get('repos:searchBaseRefs')!(null, { + repoId: 'r1', + query: 'main' + }) + ).rejects.toThrow('git remote failed: ssh connection dropped') }) - it('returns [] when the SSH provider is not connected', async () => { + it('propagates an unverifiable verdict when the SSH provider is not connected', async () => { mockStore.getRepo.mockReturnValue({ id: 'r1', path: '/remote/repo', @@ -531,11 +530,11 @@ describe('repos:searchBaseRefs SSH relay', () => { kind: 'git' }) - const result = await handlers.get('repos:searchBaseRefs')!(null, { - repoId: 'r1', - query: 'main' - }) - - expect(result).toEqual([]) + await expect( + handlers.get('repos:searchBaseRefs')!(null, { + repoId: 'r1', + query: 'main' + }) + ).rejects.toThrow('no SSH git provider for this connection') }) })