import { test, expect } from '@playwright/test'; const PAGES = [ { url: '/a-propos', title: /À propos/i }, { url: '/mentions-legales', title: /Mentions légales/i }, { url: '/dependances', title: /Dépendances/i }, { url: '/soutenir', title: /Soutenir/i }, { url: '/conseils', title: /Conseils officiels/i }, { url: '/conseils/registre-canicule', title: /Registre canicule/i }, { url: '/embed', title: /Widget intégrable/i }, { url: '/robots.txt', text: /Sitemap:/ }, { url: '/sitemap-departements.xml', text: / { if ('text' in p && p.text) { const res = await request.get(p.url); expect(res.status()).toBe(200); const body = await res.text(); expect(body).toMatch(p.text); } else if ('title' in p && p.title) { await page.goto(p.url); await expect(page.locator('h1').first()).toHaveText(p.title); } }); } test('Ko-fi link sur /soutenir', async ({ page }) => { await page.goto('/soutenir'); const link = page.getByRole('link', { name: /Soutenir sur Ko-fi/i }).first(); await expect(link).toHaveAttribute('href', /ko-fi\.com\/daelwizhit/); }); test('Mentions légales — distinction Nocleus/perso', async ({ page }) => { await page.goto('/mentions-legales'); await expect(page.getByText(/micro-entreprise/i)).toBeVisible(); await expect(page.getByText(/non lucratif/i).first()).toBeVisible(); });