From b863a4a83acfda0525925f90b546445fe7194e4f Mon Sep 17 00:00:00 2001 From: Ibrahim Khan Date: Tue, 23 Jun 2026 02:10:50 -0700 Subject: [PATCH] test(git): assert relative URLs in gitApiHttp stage/unstage tests (#1615) The runtime URL refactor in #1228 switched gitApiHttp's buildUrl from absolute window-origin URLs to the relative URLs returned by the default runtime URL resolver, but gitApiHttp.test.ts kept asserting the old absolute URLs. The two index-mutation tests have failed ever since (no CI step runs the test suite, so it went unnoticed). Update the expectations to the relative URLs the helper now produces. Co-authored-by: Ibrahim Khan --- packages/ui/src/lib/gitApiHttp.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/lib/gitApiHttp.test.ts b/packages/ui/src/lib/gitApiHttp.test.ts index 441d8002..de59719c 100644 --- a/packages/ui/src/lib/gitApiHttp.test.ts +++ b/packages/ui/src/lib/gitApiHttp.test.ts @@ -56,7 +56,7 @@ describe('gitApiHttp index mutations', () => { await stageGitFiles('/repo', ['a.ts', 'b.ts']); expect(calls).toHaveLength(1); - expect(String(calls[0].input)).toBe('http://localhost:3000/api/git/stage?directory=%2Frepo'); + expect(String(calls[0].input)).toBe('/api/git/stage?directory=%2Frepo'); expect(calls[0].init?.method).toBe('POST'); expect(JSON.parse(String(calls[0].init?.body))).toEqual({ paths: ['a.ts', 'b.ts'] }); } finally { @@ -71,7 +71,7 @@ describe('gitApiHttp index mutations', () => { await unstageGitFiles('/repo', ['a.ts', 'b.ts']); expect(calls).toHaveLength(1); - expect(String(calls[0].input)).toBe('http://localhost:3000/api/git/unstage?directory=%2Frepo'); + expect(String(calls[0].input)).toBe('/api/git/unstage?directory=%2Frepo'); expect(calls[0].init?.method).toBe('POST'); expect(JSON.parse(String(calls[0].init?.body))).toEqual({ paths: ['a.ts', 'b.ts'] }); } finally {