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 <ibrakhxn@amazon.com>
This commit is contained in:
committed by
GitHub
co-authored by
Ibrahim Khan
parent
f1c9776fde
commit
b863a4a83a
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user