From be2d2db5c3f33a24c7c1ea3fb62308fc4b4612e0 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 10 Nov 2026 01:28:21 +0800 Subject: [PATCH] gui tests: gateway mode's hidden alerts are read through their Alerts list 7d177985f put the four alert rows under an Alerts heading and hides the heading and its list as one in gateway mode, not each row. gateway-mode's agentRows still read each row's own hidden, so it went red in both engines in the full GUI run ([false,true,true,true,true]). A row now counts as shown when neither it nor its list and heading are hidden. What the user sees was right; only the test read the old layout. Run on mote: gateway-mode.test.cjs 6 of 6. Broken by hand: with the heading and list left out of the gateway-mode hide, chromium en and webkit en go red on "agents' rows in gateway mode". --- internal/gui/tests/gateway-mode.test.cjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/gui/tests/gateway-mode.test.cjs b/internal/gui/tests/gateway-mode.test.cjs index 78ece32eb..df85021e9 100644 --- a/internal/gui/tests/gateway-mode.test.cjs +++ b/internal/gui/tests/gateway-mode.test.cjs @@ -90,9 +90,13 @@ const KEPT = ["sessions", "library", "providers", "routing", "groups", "gateway" // the tabs shown, the page shown const tabs = (page) => page.evaluate(() => [...document.querySelectorAll("#nav button[data-view]")].filter((b) => !b.hidden && b.offsetParent).map((b) => b.dataset.view)); const viewShown = (page) => page.evaluate(() => [...document.querySelectorAll("main.view")].filter((v) => !v.hidden).map((v) => v.id)); -// the rows gateway mode leaves out of Settings, each shown or not +// the rows gateway mode leaves out of Settings, each shown or not: the +// alerts go with their Alerts list and heading, hidden as one const agentRows = (page) => page.evaluate(() => ["#plainNamesSegs", "#usageAlertSegs", "#balanceAlertSegs", "#resetReminderSegs", "#turnDoneSegs"] - .map((s) => !document.querySelector(s).closest(".row").hidden)); + .map((s) => { + const r = document.querySelector(s).closest(".row"), list = r.closest("#alertList"); + return !r.hidden && (!list || (!list.hidden && !document.querySelector("#alertHead").hidden)); + })); async function noSelectNoBorder(page, where) { const bad = await page.evaluate(() => {