Files
crumbs-original/tests/e2e/pwa.spec.ts
T
2026-03-05 21:16:45 +01:00

25 lines
937 B
TypeScript

import { test, expect } from '@playwright/test';
test.describe('PWA', () => {
test('Scenario: Web manifest provides correct app metadata', async ({ page }) => {
// When the browser requests the web manifest
const response = await page.goto('/manifest.webmanifest');
// Then it returns successfully with the correct app name, display mode, and icons
expect(response?.status()).toBe(200);
const manifest = await response?.json();
expect(manifest?.name).toBe('Crumbs by Bretzel');
expect(manifest?.display).toBe('standalone');
expect(manifest?.icons?.length).toBeGreaterThan(0);
});
test('Scenario: Application declares a theme color for mobile browsers', async ({ page }) => {
// Given the application is loaded
await page.goto('/login');
// Then a theme-color meta tag is present
const themeColor = await page.getAttribute('meta[name="theme-color"]', 'content');
expect(themeColor).toBeTruthy();
});
});