From 568112b85a4041977ad0f053914cdee1914260fd Mon Sep 17 00:00:00 2001 From: zwitschi Date: Thu, 13 Aug 2026 13:24:56 +0200 Subject: [PATCH] test(frontend): simplify fetch mock signatures in auth tests --- frontend/src/main.test.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/main.test.ts b/frontend/src/main.test.ts index 5c38ed8..1ab2095 100644 --- a/frontend/src/main.test.ts +++ b/frontend/src/main.test.ts @@ -440,7 +440,7 @@ describe("auth and user list wiring", () => { it("logs in and updates the auth UI", async () => { await import("../src/main"); - globalThis.fetch = vi.fn(async (url: any, opts?: any) => { + globalThis.fetch = vi.fn(async (url: any) => { const u = String(url); if (u.includes("/api/auth/login")) { return { @@ -470,13 +470,11 @@ describe("auth and user list wiring", () => { it("toggles the user list visibility", async () => { await import("../src/main"); - globalThis.fetch = vi - .fn() - .mockResolvedValue({ - ok: true, - json: async () => ({ authenticated: false, entries: [] }), - text: async () => "", - }) as any; + globalThis.fetch = vi.fn().mockResolvedValue({ + ok: true, + json: async () => ({ authenticated: false, entries: [] }), + text: async () => "", + }) as any; document.dispatchEvent(new Event("DOMContentLoaded"));