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.