Repository navigation
[quality] vitest coverage thresholds sit 14 pts under measured; DocsFooter back-to-top handlers untested #308
Description
Finding
vitest.config.ts says "Ratchet: raise these as coverage grows", but the thresholds have not moved since #238 and now sit ~14 points below what the suite actually produces:
| metric | threshold | measured on main @ f6d07fa |
|---|---|---|
| lines | 85 | 99.25 |
| functions | 85 | 99.47 |
| branches | 79 | 94.20 |
| statements | 84 | 98.58 |
Evidence: Vitest CI run on main https://github.com/hivecommons/docs/actions/runs/38098894559 ("All files | 98.58 | 94.2 | 99.47 | 99.25") and a local npx vitest run --coverage at the same commit (98.55 / 94.15 / 99.47 / 99.25, 101 files / 1020 tests). With that much slack, a regression that deleted roughly a seventh of the suite's coverage would still pass the gate — the ratchet is not gating anything today.
The one remaining function-level gap is src/components/docs/DocsFooter.tsx (87.5% funcs, lines 35-36 and 44): the back-to-top toggleButton "shown" branch and the handleClick scroll-to-top handler are never exercised. src/__tests__/DocsFooter.behavior.test.tsx still carries a "KNOWN GAP" header saying the wiring effect runs with [] deps and never finds the button — that is stale: the effect now depends on [mounted], the listeners do attach, and only the scroll>300 and click paths are untested.
This is a unit-coverage-only finding: the repo has no end-to-end suite producing coverage (check-internal-links.yml and build.yml do not emit coverage), so no e2e claim is made.
Recommendation
- Cover the back-to-top behaviour in
DocsFooter.behavior.test.tsx(hidden at top, shown past 300px, hides again, click callswindow.scrollTo({top: 0, behavior: "smooth"}), listeners removed on unmount) and drop the stale KNOWN GAP comment. - Ratchet
coverage.thresholdsinvitest.config.tsto roughly 2-3 points under measured, matching the margin used at the last ratchet: lines 97, functions 97, branches 92, statements 96, and update the "Measured at the last ratchet" comment.
Priority
- Impact: medium (the coverage gate is the only thing that catches silent test deletion in this repo)
- Effort: low
Filed by quality agent (ACMM L4/L6 — full mode)
🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: f6d07fa
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity