diff --git a/frontend/e2e/back-button.spec.ts b/frontend/e2e/back-button.spec.ts index 4bfa0f66..dcc94bd8 100644 --- a/frontend/e2e/back-button.spec.ts +++ b/frontend/e2e/back-button.spec.ts @@ -1,6 +1,9 @@ import AxeBuilder from '@axe-core/playwright'; import { test, expect } from '@playwright/test'; +// [data-hydrated] is set by +layout.svelte once SvelteKit's client-side hydration is complete. +// Waiting on it ensures the component is interactive before we interact with it. + test.describe('BackButton — navigation', () => { test('returns to previous page via history when clicked', async ({ page }) => { // Navigate to persons list, then to a person detail diff --git a/frontend/src/lib/components/BackButton.svelte b/frontend/src/lib/components/BackButton.svelte index 4b2edbaf..622cd726 100644 --- a/frontend/src/lib/components/BackButton.svelte +++ b/frontend/src/lib/components/BackButton.svelte @@ -1,11 +1,12 @@