Skip to content

test(ui): close the coverage gaps — and the deadline lie one of them was hiding#78

Merged
omercelikdev merged 3 commits into
mainfrom
test/ui-edge-cases
Jul 27, 2026
Merged

test(ui): close the coverage gaps — and the deadline lie one of them was hiding#78
omercelikdev merged 3 commits into
mainfrom
test/ui-edge-cases

Conversation

@omercelikdev

Copy link
Copy Markdown
Owner

Measured instead of guessed: vitest --coverage over kit and console, then every uncovered branch read and judged. Most were real behaviour nobody had exercised.

The bug a gap was hiding

deadlineVerdict judged a live run only on its prediction. A run still going an hour past its deadline reported "on track" — the one thing that is certainly false. It now judges the clock first, and takes now so the verdict is testable instead of reading the wall clock behind the caller's back.

Newly covered — all of it behaviour an operator depends on

  • "did not reach the server" in bulk, campaign and archival: a verb whose fate is unknown must never read as applied.
  • The kit's unexpected-status copy (unexpected 503 — check the service logs), which tells a different story from "never left the browser".
  • KeysetTable's stale-load guard: a superseded page must not overwrite the newer one (a race that only shows up under a slow first request).
  • A decided bulk batch's evidence (who, when, why), an empty definition, a lifted hold, a campaign with no window, a notification's tenant/correlation id.
  • Switching fleet closes the run belonging to the other one; a paused job offers resume and posts the frozen route.
  • Id encoding for keys with slashes and spaces; rerun's route and its throw on an unexpected status.

One behaviour change

The notification panel now re-reads the open row by id — evidence moves (Requested → Sent/Failed), so a row captured minutes ago is not what an operator should judge. It also gives the contract's by-id route its first exercise.

The floor

pnpm test in both packages now runs under coverage thresholds (kit 95/90, console 97/85 statements/branches), so CI enforces them on every PR. These gaps were branches nobody thought to exercise — a number is the only thing that notices that happening again.

kit 63 tests, console 101. Coverage on source: kit 100% statements / 97% branches, console 99.9% / 88%.

🤖 Generated with Claude Code

…was hiding

Measured instead of guessed: `vitest --coverage` over kit and console, then every
uncovered branch read and judged. Most were real behaviour nobody had exercised.

The bug: `deadlineVerdict` judged a LIVE run only on its prediction, so a run still
going an hour past its deadline reported "on track" — the one thing that is certainly
false. It now judges the clock first (and takes `now`, so the verdict is testable
instead of reading the wall clock behind the caller's back).

Newly covered, all of it behaviour an operator depends on:
- the "did not reach the server" path in bulk, campaign and archival — a verb whose fate
  is UNKNOWN must never read as applied,
- the kit's unexpected-status copy (`unexpected 503`), which says something different
  from "never left the browser",
- KeysetTable's stale-load guard: a superseded page must not overwrite the newer one,
- a decided bulk batch's evidence (who, when, why), an empty definition, a lifted hold,
  a campaign with no window, a notification's tenant and correlation id,
- switching fleet closes the run that belonged to the other one; a paused job offers
  resume and posts the frozen route,
- id encoding for keys with slashes and spaces, and `rerun`'s route + its throw on an
  unexpected status.

The notification panel now RE-READS the open row by id (evidence moves: Requested →
Sent/Failed), which also gave the contract's by-id route its first exercise.

A coverage floor now runs in CI on every PR (kit 95/90, console 97/85), because these
gaps were branches nobody thought to exercise — a number is the only thing that notices
that happening again.

kit 63 tests, console 101.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@omercelikdev

Copy link
Copy Markdown
Owner Author

Review agent v1 — 1 finding(s). The human decides; hard-stop labels need explicit resolution.

  • R6 (high) ui/console/coverage/index.html:1 — Generated vitest coverage report output (~10k+ lines of HTML/CSS/JS/JSON across ui/console/coverage/ and ui/kit/coverage/) is committed into the repository instead of being treated as build output.
    • evidence: Each generated file embeds a run timestamp (e.g. 'Code coverage generated by istanbul at 2026-07-27T09:28:17.305Z'), so every future pnpm test --coverage run will re-diff these files even with zero source changes — this is the kind of pattern a .gitignore rule prevents, not a lint rule. · action: Drop ui/console/coverage/ and ui/kit/coverage/ from this commit and add coverage/ to .gitignore in both packages.

Calibration: mark each finding accepted/dismissed in a reply — dismiss rate >40%/class revises that class (strategy §5).

The generated HTML report went in with the coverage work — ~10k lines that re-diff on
every run because each file embeds its timestamp. Removed and ignored.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@omercelikdev

Copy link
Copy Markdown
Owner Author

R6 accepted — the generated report went in with the work; ~10k lines that re-diff on every run because each file embeds its timestamp. Removed from the tree and coverage/ added to .gitignore.

I ran `pnpm test` and skipped `pnpm typecheck` — CI caught what I had not: the AppShell
case omitted a required prop and the RunProgress fixtures invented fields the type does
not have.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@omercelikdev
omercelikdev merged commit 83d9bd6 into main Jul 27, 2026
3 checks passed
@omercelikdev
omercelikdev deleted the test/ui-edge-cases branch July 27, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant