Some checks are pending
Deploy info-canicule / deploy (push) Waiting to run
Graph T° (TemperatureChartInteractive.astro) : - Onglets 24 h / 7 j / 30 j (toggle JS, séries serialisées au SSR) - Hover vertical line + tooltip valeurs - Overlay normales mois en pointillé (TX orange, TN bleu) - Onglet 24 h dispo seulement si l'API MF a répondu (best-effort) Météo France OAuth2 (lib/meteofrance-auth.ts + observations.ts) : - client_credentials avec refresh auto, cache token Valkey - Fallback METEOFRANCE_STATIC_TOKEN pour debug - /synop endpoint pour 24h horaires par station SYNOP du dept - Mapping dept → station SYNOP la plus proche (src/data/stations-synop.json) - En attente de creds : SDK skip silencieusement, l'onglet 24h n'apparaît pas Widget iframe (/embed/dept/[code] + /embed doc) : - Layout minimal sans header/footer global - Réutilisable via iframe avec une ligne - Page /embed avec snippet copier-coller + aperçu live Tests E2E Playwright (tests/e2e/) : - home (carte 96 paths, tooltip dept, navigation) - api (health, vigilance, vigilance/dept) - departement (tabs période, DROM notice, 404) - static pages (a-propos, mentions, dependances, soutenir, conseils, embed) - embed widget (rendu minimal, headers X-Frame OK) - 20+ tests, run via pnpm test:e2e (live) ou test:e2e:local Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.5 KiB
TypeScript
39 lines
1.5 KiB
TypeScript
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: /<urlset/ },
|
|
];
|
|
|
|
for (const p of PAGES) {
|
|
test(`page ${p.url} répond 200`, async ({ request, page }) => {
|
|
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();
|
|
});
|