From 6fffc06c28f887ae0efb4186725f6fb748219871 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 14 May 2026 11:58:19 +0200 Subject: [PATCH] fix(test): allow extra result properties in enhance callback type Use [key: string]: unknown index signature so TS does not reject the extra fields (location, status) passed to the redirect/failure result in the spec helpers. Co-Authored-By: Claude Sonnet 4.6 --- .../src/routes/admin/groups/new/page.svelte.spec.ts | 10 ++++++++-- .../src/routes/admin/users/new/page.svelte.spec.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/admin/groups/new/page.svelte.spec.ts b/frontend/src/routes/admin/groups/new/page.svelte.spec.ts index 615f4587..e74499cc 100644 --- a/frontend/src/routes/admin/groups/new/page.svelte.spec.ts +++ b/frontend/src/routes/admin/groups/new/page.svelte.spec.ts @@ -82,7 +82,10 @@ describe('Admin new group page – unsaved-changes guard', () => { await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument(); type SubmitFn = () => Promise< - (opts: { result: { type: string }; update: () => Promise }) => Promise + (opts: { + result: { type: string; [key: string]: unknown }; + update: () => Promise; + }) => Promise >; const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)(); await innerFn({ @@ -109,7 +112,10 @@ describe('Admin new group page – unsaved-changes guard', () => { await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument(); type SubmitFn = () => Promise< - (opts: { result: { type: string }; update: () => Promise }) => Promise + (opts: { + result: { type: string; [key: string]: unknown }; + update: () => Promise; + }) => Promise >; const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)(); await innerFn({ diff --git a/frontend/src/routes/admin/users/new/page.svelte.spec.ts b/frontend/src/routes/admin/users/new/page.svelte.spec.ts index 4ae16236..3c00ffdd 100644 --- a/frontend/src/routes/admin/users/new/page.svelte.spec.ts +++ b/frontend/src/routes/admin/users/new/page.svelte.spec.ts @@ -142,7 +142,10 @@ describe('Admin new user page – unsaved-changes guard', () => { await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument(); type SubmitFn = () => Promise< - (opts: { result: { type: string }; update: () => Promise }) => Promise + (opts: { + result: { type: string; [key: string]: unknown }; + update: () => Promise; + }) => Promise >; const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)(); await innerFn({ @@ -169,7 +172,10 @@ describe('Admin new user page – unsaved-changes guard', () => { await expect.element(page.getByText(/ungespeicherte Änderungen/i)).toBeInTheDocument(); type SubmitFn = () => Promise< - (opts: { result: { type: string }; update: () => Promise }) => Promise + (opts: { + result: { type: string; [key: string]: unknown }; + update: () => Promise; + }) => Promise >; const innerFn = await (enhanceCaptureRef.submitFn as SubmitFn)(); await innerFn({