From 7ab9847ee33350709e70facf5465fcd6c90c63d9 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Thu, 15 Aug 2024 20:12:59 -0700 Subject: [PATCH 1/3] fixes test --- test/api/openSaucedApi.test.ts | 6 +++--- test/utils/urlMatcher.test.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/api/openSaucedApi.test.ts b/test/api/openSaucedApi.test.ts index 5709f537..f5ccdd9f 100644 --- a/test/api/openSaucedApi.test.ts +++ b/test/api/openSaucedApi.test.ts @@ -14,9 +14,9 @@ describe("openSaucedUserEndpoint", () => { expect(data.login).toBe("bdougie"); }) - it("should return a 404 error for a user that does not exist", async () => { - const response = await fetch(`${OPEN_SAUCED_USERS_ENDPOINT}/1`); - expect(response.status).toBe(404); + it("should not return a 200 error for a user that does not exist", async () => { + const response = await fetch(`${OPEN_SAUCED_USERS_ENDPOINT}/foolala`); + expect(response.status).not.toBe(200); }) }) diff --git a/test/utils/urlMatcher.test.ts b/test/utils/urlMatcher.test.ts index 06076875..966de389 100644 --- a/test/utils/urlMatcher.test.ts +++ b/test/utils/urlMatcher.test.ts @@ -98,7 +98,7 @@ test('getPullRequestAPIURL', async () => { expect(await getPullRequestAPIURL('https://github.com/open-sauced/ai/pull/164')).toBe('https://api.github.com/repos/open-sauced/ai/pulls/164') expect(await getPullRequestAPIURL('https://github.com/open-sauced/ai/pull/163')).toBe('https://api.github.com/repos/open-sauced/ai/pulls/163') expect(await getPullRequestAPIURL('https://github.com/open-sauced/ai/compare/some-branch')).toBe('https://api.github.com/repos/open-sauced/ai/compare/beta...some-branch') - expect(await getPullRequestAPIURL('https://github.com/tailwindlabs/tailwindcss/compare/some-branch')).toBe('https://api.github.com/repos/tailwindlabs/tailwindcss/compare/master...some-branch') + expect(await getPullRequestAPIURL('https://github.com/tailwindlabs/tailwindcss/compare/some-branch')).toBe('https://api.github.com/repos/tailwindlabs/tailwindcss/compare/next...some-branch') expect(await getPullRequestAPIURL('https://github.com/open-sauced/ai/compare/beta...some-branch')).toBe('https://api.github.com/repos/open-sauced/ai/compare/beta...some-branch') expect(await getPullRequestAPIURL('https://github.com/tailwindlabs/tailwindcss/compare/master...some-branch')).toBe('https://api.github.com/repos/tailwindlabs/tailwindcss/compare/master...some-branch') From 55a86bd01ad921d69050f1055b7b54e5c4a3023b Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Fri, 16 Aug 2024 06:46:14 -0700 Subject: [PATCH 2/3] Update openSaucedApi.test.ts Co-authored-by: Nick Taylor --- test/api/openSaucedApi.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/api/openSaucedApi.test.ts b/test/api/openSaucedApi.test.ts index f5ccdd9f..03df2fd6 100644 --- a/test/api/openSaucedApi.test.ts +++ b/test/api/openSaucedApi.test.ts @@ -14,9 +14,10 @@ describe("openSaucedUserEndpoint", () => { expect(data.login).toBe("bdougie"); }) - it("should not return a 200 error for a user that does not exist", async () => { + it("should return a bad request for a user that does not exist", async () => { const response = await fetch(`${OPEN_SAUCED_USERS_ENDPOINT}/foolala`); - expect(response.status).not.toBe(200); + expect(response.status).toBe(400); + }) }) }) From e90eeeb101ddc312bf5cb40d99007345cb3918b7 Mon Sep 17 00:00:00 2001 From: Brian 'bdougie' Douglas Date: Mon, 19 Aug 2024 09:55:21 -0700 Subject: [PATCH 3/3] remove extra } --- test/api/openSaucedApi.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/api/openSaucedApi.test.ts b/test/api/openSaucedApi.test.ts index 03df2fd6..8b902e3a 100644 --- a/test/api/openSaucedApi.test.ts +++ b/test/api/openSaucedApi.test.ts @@ -18,7 +18,6 @@ describe("openSaucedUserEndpoint", () => { const response = await fetch(`${OPEN_SAUCED_USERS_ENDPOINT}/foolala`); expect(response.status).toBe(400); }) - }) }) describe("openSaucedRepoEndpoint", () => {