From 10f7cd4e7ae97347a36b45c71c558f3d06b6a4a5 Mon Sep 17 00:00:00 2001 From: Roxue88 <39444408+bshelby88@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:49:26 -0500 Subject: [PATCH 1/2] [verified] feat: cover all pages with Vercel analytics Reconcile PR #1 onto reviewed master without changing commercial, provenance, workflow, CSP, or lockfile state. Add source and dist regression coverage for exactly one analytics queue and script per deployable HTML page. --- __tests__/metadata-deployment.test.js | 26 ++++++++++++++++++++++++++ checklist.html | 5 +++++ links.html | 5 +++++ nft.html | 5 +++++ privacy.html | 5 +++++ terms.html | 5 +++++ thanks.html | 5 +++++ 7 files changed, 56 insertions(+) diff --git a/__tests__/metadata-deployment.test.js b/__tests__/metadata-deployment.test.js index 02bdd39..1d6f52b 100644 --- a/__tests__/metadata-deployment.test.js +++ b/__tests__/metadata-deployment.test.js @@ -10,10 +10,16 @@ const ITEM_FILES = Array.from({ length: 10 }, (_, index) => `${index + 1}.json`) const METADATA_FILES = [...ITEM_FILES, 'collection.json']; const CANONICAL_ORIGIN = 'https://royalruby.io'; const BLOCKED_CLAIMS = /unlockable|open[- ]edition|holders? (?:get|receive)|auto-enrollment|early access|mint(?:ing| is live| live)|available now|buy now|purchase|holder benefits?/i; +const HTML_PAGES = readdirSync(ROOT).filter((name) => name.endsWith('.html')).sort(); const readJson = (base, file) => JSON.parse(readFileSync(join(ROOT, base, file), 'utf8')); const metadataText = (metadata) => JSON.stringify(metadata); +function expectOneAnalyticsLoader(html, page) { + expect(html.match(/window\.va\s*=\s*window\.va\s*\|\|\s*function/g) ?? [], `${page} queue loader`).toHaveLength(1); + expect(html.match(/\/_vercel\/insights\/script\.js/g) ?? [], `${page} insights script`).toHaveLength(1); +} + function expectCanonicalAndTruthful(metadata, file) { const text = metadataText(metadata); expect(text, file).not.toMatch(BLOCKED_CLAIMS); @@ -93,3 +99,23 @@ describe('production deployment truth gates', () => { expect(health).toMatch(/provenance\.commit\s*===\s*EXPECTED_COMMIT/); }); }); + +describe('Vercel Web Analytics coverage', () => { + it.each(HTML_PAGES)('source %s has exactly one queue and insights loader', (page) => { + expectOneAnalyticsLoader(readFileSync(join(ROOT, page), 'utf8'), `source/${page}`); + }); + + it.each(HTML_PAGES)('dist %s has exactly one queue and insights loader', (page) => { + expectOneAnalyticsLoader(readFileSync(join(ROOT, 'dist', page), 'utf8'), `dist/${page}`); + }); + + it('preserves the privacy disclosure and exact 90-day attribution retention', () => { + const privacy = readFileSync(join(ROOT, 'privacy.html'), 'utf8'); + expect(privacy).toMatch(/anonymous usage data through privacy-friendly analytics/i); + expect(privacy).toMatch(/affiliate/i); + expect(privacy).toMatch(/UTM/i); + expect(privacy).toMatch(/first-party cookies?/i); + expect(privacy).toMatch(/localStorage/i); + expect(privacy).toMatch(/retain(?:ed)? (?:them|these attribution values) for exactly 90 days/i); + }); +}); diff --git a/checklist.html b/checklist.html index ab6b125..8b36db5 100644 --- a/checklist.html +++ b/checklist.html @@ -14,6 +14,11 @@ + + +