From 84908953f41e6ea71894c3bc7f9c044c4595a874 Mon Sep 17 00:00:00 2001 From: Norton Andreev Date: Thu, 22 Aug 2024 18:58:37 +0300 Subject: [PATCH] web-wallet: Refactor redirect tests Resolves #2193 --- .../src/lib/navigation/__tests__/redirect.spec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web-wallet/src/lib/navigation/__tests__/redirect.spec.js b/web-wallet/src/lib/navigation/__tests__/redirect.spec.js index 0116924339..abf723d72b 100644 --- a/web-wallet/src/lib/navigation/__tests__/redirect.spec.js +++ b/web-wallet/src/lib/navigation/__tests__/redirect.spec.js @@ -18,6 +18,8 @@ describe("redirect", () => { }); it("should add the defined base path to SvelteKit's `redirect` calls for absolute paths", () => { + expect.assertions(3); + redirect(300, "/"); redirect(301, "/foo/path"); @@ -26,7 +28,9 @@ describe("redirect", () => { expect(redirectMock).toHaveBeenNthCalledWith(2, 301, `${base}/foo/path`); }); - it("should add nothing for relative paths and complete string URLs", async () => { + it("should add nothing for relative paths and complete string URLs", () => { + expect.assertions(3); + redirect(300, "foo/bar"); redirect(300, "http://example.com/"); @@ -35,7 +39,9 @@ describe("redirect", () => { expect(redirectMock).toHaveBeenNthCalledWith(2, 300, "http://example.com/"); }); - it("should do nothing if the received path is an URL object", async () => { + it("should do nothing if the received path is an URL object", () => { + expect.assertions(2); + const url = new URL("http://www.example.com/"); redirect(300, url);