From 5e3dd1d52213a838ff4253b9de65bf16eb3d553e Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 27 Oct 2026 10:25:49 +0800 Subject: [PATCH] gui tests: account discovery compares with the first row that has Off and On (#3497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e698a688f put a "What was masked" row, an Open onto Insights › Masking with no Off and On, at the top of #redactList. account-discovery took the list's first row as Mask secrets and compared its own Off/On with nothing, so it was red on main in both engines. Ported from ggbdpq's hunt79-k-3497 (4dc732cd). Run at this head: node --test tests/account-discovery.test.cjs from internal/gui: 32 pass, 0 fail (it was 2 not ok in the whole GUI suite at a87f05197). Co-authored-by: ggbdpq --- internal/gui/tests/account-discovery.test.cjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/gui/tests/account-discovery.test.cjs b/internal/gui/tests/account-discovery.test.cjs index e7c187766..dfea58396 100644 --- a/internal/gui/tests/account-discovery.test.cjs +++ b/internal/gui/tests/account-discovery.test.cjs @@ -108,8 +108,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", const sub = (await box.locator(".sub").textContent()).trim(); assert(sub.includes("Claude Code") && sub.includes("Codex"), "the sub names what is read: " + sub); if (lang !== "en") assert(!sub.startsWith("Read the accounts"), lang + " sub not translated"); - // the same Off and On as Mask secrets above it - assert.deepEqual(await opts.allTextContents(), await page.locator("#redactList .row").first().locator(".opt").allTextContents()); + // the same Off and On as Mask secrets above it (the list opens + // with "What was masked", an Open onto Insights › Masking, which + // has no Off and On of its own) + assert.deepEqual(await opts.allTextContents(), await page.locator("#redactList .row").filter({ has: page.locator(".opt") }).first().locator(".opt").allTextContents()); assert.equal(await opts.nth(1).evaluate((b) => b.classList.contains("on")), true, "On by default"); const row = box.locator(".row");