Skip to content

Commit

Permalink
Fix add-on test
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Apr 26, 2024
1 parent dc6827d commit f33b821
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/api/addons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("getAddons", () => {
});
it("calls the addons API endpoint", async () => {
await addons.getAddons({}, mockFetch);
const expectedEndpoint = new URL(`addons`, BASE_API_URL);
const expectedEndpoint = new URL("addons/", BASE_API_URL);
expect(mockFetch).toHaveBeenCalledWith(
expectedEndpoint,
expect.any(Object),
Expand All @@ -28,7 +28,7 @@ describe("getAddons", () => {
{ active: true, featured: true, query: "foobar" },
mockFetch,
);
const expectedEndpoint = new URL(`addons`, BASE_API_URL);
const expectedEndpoint = new URL("addons/", BASE_API_URL);
expectedEndpoint.searchParams.set("active", "true");
expectedEndpoint.searchParams.set("featured", "true");
expectedEndpoint.searchParams.set("query", "foobar");
Expand Down Expand Up @@ -57,7 +57,7 @@ test("getPinnedAddons", async () => {
.mockResolvedValue({ ok: true, json: async () => {} });
await addons.getPinnedAddons(mockFetch);
expect(mockFetch).toHaveBeenCalledWith(
new URL(`addons?active=true`, BASE_API_URL),
new URL(`addons/?active=true`, BASE_API_URL),
expect.any(Object),
);
});
Expand All @@ -76,7 +76,7 @@ describe("getAddon", async () => {
it("calls the addons list endpoint with a respository query argument", async () => {
await addons.getAddon("MuckRock", "addon-repo", mockFetch);
expect(mockFetch).toHaveBeenCalledWith(
new URL(`addons?repository=MuckRock%2Faddon-repo`, BASE_API_URL),
new URL(`addons/?repository=MuckRock%2Faddon-repo`, BASE_API_URL),
expect.any(Object),
);
});
Expand Down

0 comments on commit f33b821

Please sign in to comment.