import { expect, test } from '@playwright/test' test('navigates between the main pages', async ({ page, isMobile }) => { await page.goto('/') await expect(page.getByRole('heading', { level: 1 })).toContainText('Jordan') for (const name of ['Incidents', 'Locations', 'Analytics']) { if (isMobile) await page.getByRole('button', { name: 'Open menu' }).click() await page.getByRole('navigation').getByRole('link', { name }).click() await expect(page.getByRole('heading', { level: 1, name })).toBeVisible() } }) test('reports an incident', async ({ page }) => { await page.goto('/report') await page.getByLabel('Incident title').fill('Blocked fire exit in warehouse') await page.getByLabel('Specific location').fill('North exit') await page.getByRole('button', { name: /submit report/i }).click() await expect(page).toHaveURL(/\/incidents$/) await expect(page.getByText('Blocked fire exit in warehouse')).toBeVisible() }) test('loads bundled fonts without third-party requests', async ({ page }) => { const external: string[] = [] page.on('request', (request) => { if (!request.url().startsWith('http://localhost')) external.push(request.url()) }) await page.goto('/') await page.evaluate(() => document.fonts.ready) expect(await page.evaluate(() => document.fonts.check('16px "DM Sans Variable"'))).toBe(true) expect(external).toEqual([]) })