Skip to content

test(web): cover slot-actions and progress-block logic - #1080

Merged
selfcontained merged 1 commit into
mainfrom
agt_6c534803317a/job-test-enforcer-d14bc5b7
Sep 11, 2026
Merged

test(web): cover slot-actions and progress-block logic#1080
selfcontained merged 1 commit into
mainfrom
agt_6c534803317a/job-test-enforcer-d14bc5b7

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

Routine test-enforcer maintenance run. Local suite was already green (42nd+ consecutive) with no failures, no flakes, and no unrelated CI issues — so this run added coverage per the carried-forward next_focus (agent-surfaces block components).

Changes

  • slot-actions.test.tsx (13 tests): SlotActions' main-action selection algorithm (primary promotion, non-destructive fallback, order-independence of authored position), the menu-needed threshold logic (including the some-vs-every empty-array edge case), the confirm-dialog open/cancel/confirm wiring and payload (blockId/actionId/baseRevision), readOnly/durable-interaction locking, and authored-disabled aria-disabled wiring.
  • progress-block.test.tsx (10 tests): ProgressBlockView's percent calculation, value/max clamping (both directions), the non-positive-max divide-by-zero guard, round-vs-floor rounding, label/title precedence for the heading vs. the progress line, the three-way ARIA-label fallback chain, tone-driven fill class, and detail-markdown gating.

Both files were built against pre-existing, unmodified source (slot-actions.tsx, progress-block.tsx) — no product code changed.

Verification

  • Manual mutation battery: 24 behavior-changing mutations across both source files, all reverted after confirming a test failure. 1 mutant (handleClick's own action.disabled || readOnly guard) is confirmed unobservable — already fully covered by ActionRefButton's own click-blocking when disabled/authored-disabled, verified against the whole 217-test agent-surfaces suite. Recorded as a code-cleanup note in the test-enforcer backlog, not treated as a test gap.
  • One general-purpose review agent reviewed the diff; it found 2 real pnpm run check type errors (an invalid tone: "danger" value for ProgressBlock, which deliberately excludes danger; and a string[] return type that should have tolerated null from getAttribute) and 2 duplicate tests with no unique mutation-kill value. All four fixed; mutation kill for the affected assertion re-verified after the fix.
  • pnpm run check, pnpm run format, pnpm run test (server 186f/3279t, web 130f/1911t, ext 9f/60t), pnpm run finalize:web, pnpm run test:e2e (198 passed/12 skipped), and pnpm run test:e2e:live (11/11, zero leaked tmux sessions) all green.
  • CI scan of the last 50 runs found no cross-branch flakes — all failures were confined to one other in-flight WIP branch's own issues (unrelated to this change).

Deliberately not tested: Radix DropdownMenu's open-menu contents (item ordering, destructive separator, busy spinner in the trigger) — no precedent exists elsewhere in this repo's apps/web suite for opening a Radix dropdown in jsdom (likely missing PointerEvent/hasPointerCapture polyfills), so this is an intentionally-deferred gap, not an oversight.

🤖 Generated with Claude Code

…ock math

- slot-actions.test.tsx: main-action selection (primary promotion,
  non-destructive fallback, order-independence), menu-needed thresholds,
  confirm-dialog open/cancel/confirm wiring, action payload fields,
  readOnly/durable-state locking, authored-disabled aria wiring.
- progress-block.test.tsx: percent calculation, value/max clamping,
  non-positive max guard, round-vs-floor, label/title precedence, ARIA
  label fallback chain, tone class, detail markdown gating.

Both files went through a manual mutation battery (24 mutants total,
all observable ones killed). One confirmed-unobservable redundant guard
found in slot-actions.tsx's handleClick (already fully covered by
ActionRefButton's own disabled/authoredDisabled click guard) — not a
test gap, recorded in the test-enforcer backlog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 4aa65c5 into main Sep 11, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_6c534803317a/job-test-enforcer-d14bc5b7 branch September 11, 2026 02:44
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