From 8b3cb681c735a040be3533f5f7e0a9919d647471 Mon Sep 17 00:00:00 2001 From: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Tue, 10 Nov 2026 00:45:12 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20test(dashboard):=20pin=20the=20h?= =?UTF-8?q?uman-gate=20pill's=20stacked-head=20fold=20from=20#17515?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- .../stage_tracker_human_gate_test.go | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/src/pkg/dashboard/stage_tracker_human_gate_test.go b/src/pkg/dashboard/stage_tracker_human_gate_test.go index 5fe49ba69b..53cec8f3a2 100644 --- a/src/pkg/dashboard/stage_tracker_human_gate_test.go +++ b/src/pkg/dashboard/stage_tracker_human_gate_test.go @@ -225,3 +225,68 @@ assert.strictEqual(link[2], 'hivecommons/hive/issue#17451'); assert.strictEqual(link[3], 'decision pending on #17480'); `) } + +// TestStageTrackerHumanGateFoldsOnStackedHead pins the render-time fold from +// #17515: at the stacked-head breakpoint (STAGE_TRACKER_GATE_FOLD_QUERY) the +// pill keeps ONE verb inline and parks the rest in the … template, while +// the strip tier still shows STAGE_TRACKER_GATE_VISIBLE. The node harness +// has no matchMedia, so without a stub this arm never ran. +func TestStageTrackerHumanGateFoldsOnStackedHead(t *testing.T) { + html := indexHTML(t) + runStageTrackerRowActionsScript(t, stageTrackerRowsPreludeJS(t, html)+"\n"+ + jsFunc(t, html, "stageTrackerHumanAttentionOf")+"\n"+ + jsFunc(t, html, "stageTrackerNeedsHumanAsk")+"\n"+ + jsFunc(t, html, "stageTrackerHoldPill")+"\n"+ + jsFunc(t, html, "stageTrackerHoldTip")+"\n"+ + stageTrackerRowsFixtureJS+` +const seen = new Date(now - 60000).toISOString(); +const inlineVerbs = (html) => Array.from(html.split(']*>([^<]*)<\/button>/g)).map(m => m[1]); +const menuVerbs = (html) => { const tpl = /