gui tests: account discovery compares with the first row that has Off and On (#3497)

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 <ggbdpq@gmail.com>
This commit is contained in:
yetone
2026-10-27 10:25:49 +08:00
co-authored by ggbdpq
parent a87f051974
commit 5e3dd1d522
@@ -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");