import { describe, it, expect, beforeAll } from 'vitest'; import { execSync } from 'node:child_process'; import { readFileSync } from 'node:fs'; describe('BaseLayout SEO tags and theming', () => { beforeAll(() => { execSync('npm run build', { stdio: 'inherit' }); }); it('sets canonical and hreflang alternates pointing at each other', () => { const en = readFileSync('dist/en/index.html', 'utf-8'); const fr = readFileSync('dist/fr/index.html', 'utf-8'); expect(en).toContain('rel="canonical" href="https://www.ombrora.com/en/"'); expect(en).toContain('hreflang="fr" href="https://www.ombrora.com/fr/"'); expect(fr).toContain('rel="canonical" href="https://www.ombrora.com/fr/"'); expect(fr).toContain('hreflang="en" href="https://www.ombrora.com/en/"'); }); it('uses the locale-specific meta title and description', () => { const en = readFileSync('dist/en/index.html', 'utf-8'); const fr = readFileSync('dist/fr/index.html', 'utf-8'); expect(en).toContain('Ombrora — Security tracking and file tools'); expect(fr).toContain('Ombrora — Veille sécurité et outils de fichiers'); }); it('includes a pre-paint theme script keyed on ombrora-theme', () => { const en = readFileSync('dist/en/index.html', 'utf-8'); expect(en).toContain("localStorage.getItem('ombrora-theme')"); expect(en).toContain('prefers-color-scheme: light'); }); it('applies the global stylesheet (inlined or linked)', () => { const en = readFileSync('dist/en/index.html', 'utf-8'); const hasInlineStyle = /