import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; const ROUTES = [ 'dist/index.html', 'dist/kundalini/index.html', 'dist/volver-a-ti/index.html', 'dist/descargo/index.html', ]; function readRoute(routePath) { return fs.readFileSync(path.resolve(routePath), 'utf-8'); } function readBuiltCss() { const assetsDir = path.resolve('dist/assets'); const cssFiles = fs.readdirSync(assetsDir).filter((file) => file.endsWith('.css')); assert.ok(cssFiles.length > 0, 'dist/assets must contain at least one built CSS file'); return cssFiles.map((file) => fs.readFileSync(path.join(assetsDir, file), 'utf-8')).join('\n'); } function extractBody(html, routePath) { const match = html.match(/
]*>([\s\S]*)<\/body>/i); assert.ok(match, `${routePath}: built HTML must contain a element`); return match[1]; } function extractFloatingWhatsAppLink(html, routePath) { const match = html.match(/]*class="[^"]*\bfixed\b[^"]*"[^>]*>[\s\S]*?<\/a>/i); assert.ok(match, `${routePath}: built HTML must contain a floating .fixed WhatsApp link`); return match[0]; } function hasAccessibleTapTarget(classAttr) { return ( /\bpy-(?:1\.5|2|2\.5)\b/.test(classAttr) || (/\binline-flex\b/.test(classAttr) && /\bmin-h-\[24px\]\b/.test(classAttr)) ); } test('Issue #11 Acceptance Criteria: A11y foundations, contrast, and sticky header', async (t) => { await t.test('Criterion 1a: every built route defines