mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 12:06:57 +02:00
25 lines
937 B
TypeScript
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();
|
|
});
|
|
});
|