Skip to content

fix(ci): restore unit coverage and contrast audit after R4 - #178

Merged
audreyt merged 2 commits into
mainfrom
fix/ci-after-r4
Oct 16, 2026
Merged

audreyt merged 2 commits into
mainfrom
fix/ci-after-r4

Conversation

@audreyt

@audreyt audreyt commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes the two CI jobs that failed on main after #177 (run 38903942640).

Unit tests (vitest): all 2178 tests passed, but the 100% coverage floor failed on branches the stage branch added without direct-call tests. Adds 7 tests: R4's shell-unavailable 404 and HEAD 404 (worker/index.ts), probeDictionaryEntry's NFKC fallback (hit / miss / both fail-open paths), a bare prefixed legacy hash (#', #:), and applyLegacyHashRewrite without a DOM.

Dark/light contrast audit: R4 made unmatched entry paths 404, and the CI audit's first five routes included /生 and /:客, which the Miniflare fixture never seeded (they had been auditing soft-200 not-found pages). CI now uses an explicit fixture-seeded list (/萌 /黃 /'食 /'長褲 /:字); the full route list for local runs is unchanged. The hover step also skips the external 異體字 icon, which is the first result link on Hakka entries and never opens a tooltip.

Verified locally: vp run test:unit --coverage 2185 passed, 100% statements/branches/functions/lines; CI-mode contrast audit against the seeded fixture server: 0 contrast failures, 0 unexpected action failures; vp check 0 errors.

No runtime code changes, so no deploy is needed.

CI on 4b8481a failed the unit job's coverage floor: branches added by the
stage branch had no direct-call tests. Covers R4's shell-unavailable and
HEAD 404s (worker/index.ts), probeDictionaryEntry's NFKC fallback and both
fail-open paths, a bare prefixed legacy hash, and the hash shim's no-DOM guard.
R4 makes unmatched entry paths hard-404, and the CI audit's first five routes
included /生 and /:客, which the Miniflare fixture never seeded (they used to
soft-200 as not-found pages). CI now audits an explicit fixture route list
(/萌 /黃 /'食 /'長褲 /:字); the full list for local runs is unchanged.

The hover step now skips the external 異體字 icon (.variants-link), which is
the first result link on Hakka entries and never opens a tooltip.
@audreyt
audreyt merged commit 14400b6 into main Oct 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant