From 2a4ee5db556d2e84e5038514fc0d15948fabc584 Mon Sep 17 00:00:00 2001 From: quality Date: Sat, 3 Oct 2026 15:17:59 -0400 Subject: [PATCH] test: cover hero and projects carousel scripts with a stub-DOM self-test Extracts the [data-hero-carousel] and [data-carousel] inline scripts from index.html and runs them against a dependency-free stub DOM with deterministic timers: dot generation, slide/aria-current state, live-region text, keyboard/swipe/hash navigation, auto-rotate and every pause condition, hero height measurement (clones, resize debounce) and projects scroll-sync (debounced scroll, scrollend, IntersectionObserver). Refs #78 (the links.yml wiring line is left for a human; see the issue) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality --- README.md | 6 + scripts/carousels.test.mjs | 816 +++++++++++++++++++++++++++++++++++++ 2 files changed, 822 insertions(+) create mode 100644 scripts/carousels.test.mjs diff --git a/README.md b/README.md index 63a46b2..8f74a72 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ entry has no committed page, or a committed page differs from what the script em `index.html` against a stub DOM with deterministic timers and checks tab activation, roving tabindex, arrow/Home/End keys, auto-rotation, and every pause condition (hover, focus, hidden tab, reduced motion, out of view). Zero dependencies. +- `node --test scripts/carousels.test.mjs` — runs the hero carousel and projects carousel + scripts from `index.html` against a stub DOM with deterministic timers and checks dot + generation, slide/`aria-current` state, live-region announcements, keyboard/swipe/hash + navigation, auto-rotate and every pause condition, hero height measurement (clones, + resize debounce), and projects scroll-sync (debounced scroll, `scrollend`, + IntersectionObserver). Zero dependencies. - `node --test scripts/page-scripts.test.mjs` — static gate over every committed HTML page: each inline `