mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:01:09 +02:00
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:
parent
51f80f43b6
commit
1a91bd7cfb
1 changed files with 19 additions and 0 deletions
19
apps/calendar/apps/web/e2e/error-page.spec.ts
Normal file
19
apps/calendar/apps/web/e2e/error-page.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue