test(frontend): simplify fetch mock signatures in auth tests
CI / test (push) Failing after 2m49s
CI / docker (push) Skipped

This commit is contained in:
zwitschi committed 2026-08-13 13:24:56 +02:00
1 parent 02ff53229c
commit 568112b85a
1 file changed
+6 -8
+6 -8
View File
@@ -440,7 +440,7 @@ describe("auth and user list wiring", () => {
it("logs in and updates the auth UI", async () => { it("logs in and updates the auth UI", async () => {
await import("../src/main"); await import("../src/main");
globalThis.fetch = vi.fn(async (url: any, opts?: any) => { globalThis.fetch = vi.fn(async (url: any) => {
const u = String(url); const u = String(url);
if (u.includes("/api/auth/login")) { if (u.includes("/api/auth/login")) {
return { return {
@@ -470,13 +470,11 @@ describe("auth and user list wiring", () => {
it("toggles the user list visibility", async () => { it("toggles the user list visibility", async () => {
await import("../src/main"); await import("../src/main");
globalThis.fetch = vi globalThis.fetch = vi.fn().mockResolvedValue({
.fn() ok: true,
.mockResolvedValue({ json: async () => ({ authenticated: false, entries: [] }),
ok: true, text: async () => "",
json: async () => ({ authenticated: false, entries: [] }), }) as any;
text: async () => "",
}) as any;
document.dispatchEvent(new Event("DOMContentLoaded")); document.dispatchEvent(new Event("DOMContentLoaded"));