From 43defa41c4962a2b0d716ee9f515b8830b3dfa56 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 23 Mar 2026 09:48:05 +0100 Subject: [PATCH] fix(e2e): wait for hydration before clicking nav dropdown in logout test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit waitForURL('/') resolves as soon as the URL changes but before SvelteKit finishes hydrating — the avatar button's onclick is not yet registered, so the click has no effect and the dropdown never opens. Co-Authored-By: Claude Sonnet 4.6 --- frontend/e2e/auth.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/e2e/auth.spec.ts b/frontend/e2e/auth.spec.ts index 767da083..da5c4118 100644 --- a/frontend/e2e/auth.spec.ts +++ b/frontend/e2e/auth.spec.ts @@ -61,6 +61,9 @@ test.describe('Authentication', () => { test('logout clears the session and redirects to /login', async ({ page }) => { await login(page); + // Wait for hydration before interacting with the nav — onclick handlers are + // only wired up after SvelteKit finishes hydrating the page client-side. + await page.waitForSelector('[data-hydrated]'); // Logout is inside the user avatar dropdown — open it first. // Wait for the dropdown button to be visible before clicking Abmelden, // since the {#if userMenuOpen} block renders asynchronously in Svelte.