Repository navigation
🌱 test(dashboard): pin the human-gate pill's stacked-head fold from #17515 - #17524
Conversation
…17515 The node harness that renders tracker rows has no matchMedia, so stageTrackerHumanGateVisible() always returned STAGE_TRACKER_GATE_VISIBLE under test and the one-verb-plus-… arm (≤1100px) added by #17515 never ran. Stub window.matchMedia and assert the fold for four-, three- and two-verb pills, the strip-tier count when the query does not match, and the no-matchMedia fallback. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Reviewed by Reviewer notesRead
Test-only; dashboard CI shards are green on this head. No findings. |
|
CI triage: the red marks on this PR are concurrency-cancelled duplicate runs (DCO squash attribution / PR Verifier, 1–2s each) that were superseded by passing reruns on the same head 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Read the test against static-src/js/tracker-human-gate.js on v5 and the harness prelude; this looks correct to me.
stageTrackerHumanGateVisible()(tracker-human-gate.js:149-151) returns1only whenwindow.matchMedia(STAGE_TRACKER_GATE_FOLD_QUERY).matches, elseSTAGE_TRACKER_GATE_VISIBLE; the stub in the test drives exactly that branch and thedelete window.matchMediaarm hits thetypeof … === 'function'guard. The prelude declaresconst window = {}(stage_tracker_ui_prelude_test.go:14), so assigning/deleting a property is fine.inlineVerbsmatchesclass="ham-lead-act ham-gate-act"(:143) and therefore excludes both the…button (ham-gate-moreappended,:201) and the menu items (ham-menu-item …,:142);menuVerbsreads only inside the<template>. The two selectors are disjoint, so "no duplicates" is actually pinned, not assumed.- The module-level
mq.addEventListener('change', …)wiring (:152-155) is not lifted byjsFunc, so the stub's no-opaddEventListeneris harmless and the test is not accidentally re-rendering. - Fixtures are the same three rows
TestStageTrackerHumanGateRowsalready uses, with the same verb sets (Approve / Request changes… / Let hive decide / Confirm safe, etc.), so the expected labels are grounded in a test CI already runs green.
The only red check, relative links and anchors resolve, fails on CHANGELOG.md: broken link '…/actions/runs/<id' — a base-branch (v5) artifact this test-only diff does not touch; #17527 (docs-link check: ignore link syntax quoted in inline code spans) is the fix for it. Once that lands, this should go green on rebase/re-run.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Why
#17515 moved the human-gate pill's verb fold from CSS to render time:
stageTrackerHumanGateVisible()returns 1 whenwindow.matchMedia('(max-width: 1100px)')matches andSTAGE_TRACKER_GATE_VISIBLEotherwise, andstageTrackerHumanGateHtmlslices the verbs on that count. The node harness behindTestStageTrackerHumanGateRowsruns withconst window = {}and nomatchMedia, so every assertion in it exercises the strip tier only — the ≤1100px arm, which is the behaviour the PR exists for ("one plus…at ≤1100px"), never ran under test.This adds
TestStageTrackerHumanGateFoldsOnStackedHeadnext to it: it stubswindow.matchMedia, checks the fold query asked is the stacked-head breakpoint, and asserts for four-, three- and two-verb pills that exactly one verb rides inline and the rest wait in the<template>in pill order with no duplicates; then flips the query off and checks the strip tier is unchanged (three inline,…only once a fourth verb exists); then removesmatchMediaand checks the fallback count. Fixture rows mirror the three cases the existing test already uses.Fails on v5 without #17515's
stageTrackerHumanGateVisible(the slice would use the constant 3 regardless of the query).Test-only (
*_test.go), so no changelog fragment.— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88