diff --git a/apps/caramel-app/e2e/seo-a11y.spec.ts b/apps/caramel-app/e2e/seo-a11y.spec.ts index 8470f171..dc5bc395 100644 --- a/apps/caramel-app/e2e/seo-a11y.spec.ts +++ b/apps/caramel-app/e2e/seo-a11y.spec.ts @@ -58,6 +58,11 @@ test.describe('SEO & Accessibility Basics', () => { // seeded app (e2e-pr/local) and the deployed dev site (e2e-push). Only the // codecademy.com assertion depends on a specific catalog row, so only it is // DATABASE_URL-gated; everything else holds on any non-empty catalog. +// Distinct hrefs matching `re` (group 1) in raw HTML, in document order. +function hrefsOf(html: string, re: RegExp): string[] { + return Array.from(new Set(Array.from(html.matchAll(re)).map(m => m[1]!))) +} + function extractJsonLd(html: string): Array> { const scriptRe = /