test(calendar-web): add E2E test for 404 error page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-24 10:22:56 +01:00
parent 51f80f43b6
commit 1a91bd7cfb

View file

@ -0,0 +1,19 @@
import { test, expect } from '@playwright/test';
test.describe('Error Page', () => {
test('visiting a nonexistent route shows error page with status code', async ({ page }) => {
const response = await page.goto('/nonexistent-route-that-does-not-exist');
// SvelteKit should return a 404 status
expect(response?.status()).toBe(404);
// The error page should display the status code
const statusHeading = page.locator('h1');
await expect(statusHeading).toBeVisible({ timeout: 10000 });
await expect(statusHeading).toContainText('404');
// Should show a "back to home" link
const backLink = page.locator('a[href="/"]');
await expect(backLink).toBeVisible();
});
});