Files
magpie/internal/gui/tests/usage-checkin.test.cjs
T
yetone d67a482908 provider: a Trae CN claim answered 9074 is final for the day and says to check in in the Trae CN app (#808)
When /status says the check-in is on and today's isn't in, and /claim
answers 9074 「当前参与用户太多,请稍后再试」, the check-in is now saved
with a new outcome, own-app, instead of failed. Like every answer other
than failed it settles the Beijing day: the loop doesn't claim again
after the 30-minute retry, and Check in now isn't offered (a press
wouldn't claim either). The next day is asked as before.

Why: Trae CN pays check-in credits only to a device registered through
its own device-register service and security SDK. The plugin's device id
isn't, so 9074 is permanent for it; across ~5 days on #808 no retry ever
succeeded, and repeated claims from an unknown device may read as abuse.

What the user sees, in en/zh/zh-TW/ja/de: the Usage card's check-in row
and the Settings "Daily check-in" line say "Trae CN only gives check-in
credits to its own app; check in in the Trae CN app" (zh: Trae CN 只给自己的
客户端发签到积分,请在 Trae CN App 里签到), with Trae's own message in the
tooltip. The TUI and `magpie accounts checkin` say the same.

Unchanged: 9074 on /status (before any claim) and every other code keep
their handling; WorkBuddy, MiniMax, Qoder and plugin check-ins untouched.
docs/subsystems/provider-plugins.md describes it.

Run:
- TestTraeCheckin9074IsOwnAppOnly with trae_checkin.go at HEAD fails:
  "same day, soon=false, asked again after 9074: [POST /status POST
  /claim]"; with the change it passes.
- usage-checkin.test.cjs new case on old app.js fails (row said "Check-in
  failed; magpie tries again later · 当前参与用户太多…"); with the change all
  28 pass in Chromium and WebKit, en and zh. plugin-checkin 16/16,
  i18n-keys, gui-ja, gui-de, gui-zh-tw pass.
- go test -tags nogui ./internal/provider ./internal/gui ./internal/tui .
  under a sandbox HOME: ok.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui on the
  touched packages: clean.
- Not tried against a real Trae CN account (none here); the 9074 bytes
  are the reporter's from #808.
2026-10-10 19:50:16 +08:00

368 lines
23 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Run with Node's test runner and Playwright on the module path; see README.md.
// #694 (Dazzle-sys): "put the check-in settings on the Usage card, and show
// on the card whether today's check-in is done; having to look in Settings
// to know whether it checked in is wrong". A WorkBuddy (China) account's
// card says how its daily check-in went — today's with the credits and the
// streak, not eligible, failed, or not yet with the last day it was — a
// dot beside it; the card's first such row has Auto check-in, the same
// switch as Settings' Daily check-in (POST /api/settings/workbuddy-checkin),
// and Check in now while an account isn't in today
// (POST /api/usage/workbuddy-checkin). Another vendor's card has none of it.
// Clicks never move the page. A Trae CN account's card (Hu9956: TRAE cn
// 也有每天签到送100积分) has the same row, with its own switch
// (POST /api/settings/trae-checkin) and press (POST /api/usage/trae-checkin),
// the WorkBuddy one left as it was; so has a MiniMax Code account's (#811,
// POST /api/settings/minimax-checkin and /api/usage/minimax-checkin), and
// a Qoder account's, its daily credits (ARNO on Discord,
// POST /api/settings/qoder-checkin and /api/usage/qoder-checkin).
// English and Chinese; the API is faked here.
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const path = require("node:path");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
const assets = path.resolve(__dirname, "../assets");
const today = new Date(Date.now() + 8 * 3600e3).toISOString().slice(0, 10);
const quotas = () => [
{ provider: "workbuddy", name: "WorkBuddy", icon: "workbuddy-color", plan: "Pro", user: "李雷", windows: [{ name: "Credits", used: 8.9 }],
checkins: true, checkin: { user: "李雷", day: today, outcome: "claimed", credit: 50, streak: 3 } },
{ provider: "workbuddy", name: "WorkBuddy", icon: "workbuddy-color", plan: "Free", user: "韩梅梅", windows: [{ name: "Credits", used: 2 }],
checkins: true, checkin: { user: "韩梅梅", day: "2026-09-30", outcome: "claimed", credit: 20 } },
{ provider: "workbuddy", name: "WorkBuddy", icon: "workbuddy-color", plan: "Free", user: "Lucy", windows: [{ name: "Credits", used: 1 }],
checkins: true, checkin: { user: "Lucy", day: today, outcome: "ineligible" } },
{ provider: "codex", name: "Codex", icon: "openai", plan: "Plus", windows: [{ name: "5 hours", used: 20 }] },
{ provider: "trae-cn", name: "Trae CN", plan: "Free", user: "hu", windows: [{ name: "Credits", used: 3 }],
checkins: true, checkinBy: "trae", checkin: { user: "hu", day: "2026-09-30", outcome: "claimed", credit: 100 } },
{ provider: "minimax-code", name: "MiniMax Code", plan: "Plus", user: "mm", windows: [{ name: "5 hours", used: 10 }],
checkins: true, checkinBy: "minimax", checkin: { user: "mm", day: "2026-10-04", outcome: "claimed", credit: 800, streak: 1 } },
{ provider: "qoder", name: "Qoder", plan: "Pro", user: "arno", windows: [{ name: "Credits", used: 12 }],
checkins: true, checkinBy: "qoder", checkin: { user: "arno", day: "2026-10-05", outcome: "claimed", credit: 100 } },
];
function serve(lang, asked) {
const settings = { theme: "light", lang, quotaLeft: false, currency: "usd", workbuddyCheckin: false, traeCheckin: false, minimaxCheckin: false, qoderCheckin: false };
return async (route) => {
const url = new URL(route.request().url());
const json = (data) => route.fulfill({ json: data });
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings });
if (url.pathname === "/api/settings") return json(settings);
if (url.pathname === "/api/settings/workbuddy-checkin") {
asked.push(["set", route.request().postDataJSON()]);
settings.workbuddyCheckin = route.request().postDataJSON().on;
return json(settings);
}
if (url.pathname === "/api/settings/trae-checkin") {
asked.push(["trae-set", route.request().postDataJSON()]);
settings.traeCheckin = route.request().postDataJSON().on;
return json(settings);
}
if (url.pathname === "/api/usage/trae-checkin") {
asked.push(["trae-now"]);
return json([{ user: "hu", by: "trae", day: today, outcome: "claimed", credit: 100 }]);
}
if (url.pathname === "/api/settings/minimax-checkin") {
asked.push(["mm-set", route.request().postDataJSON()]);
settings.minimaxCheckin = route.request().postDataJSON().on;
return json(settings);
}
if (url.pathname === "/api/usage/minimax-checkin") {
asked.push(["mm-now"]);
return json([{ user: "mm", by: "minimax", day: today, outcome: "claimed", credit: 800, streak: 2 }]);
}
if (url.pathname === "/api/settings/qoder-checkin") {
asked.push(["qd-set", route.request().postDataJSON()]);
settings.qoderCheckin = route.request().postDataJSON().on;
return json(settings);
}
if (url.pathname === "/api/usage/qoder-checkin") {
asked.push(["qd-now"]);
return json([{ user: "arno", by: "qoder", day: today, outcome: "claimed", credit: 100 }]);
}
if (url.pathname === "/api/usage/workbuddy-checkin") {
asked.push(["now"]);
return json([{ user: "韩梅梅", day: today, outcome: "claimed", credit: 20 }]);
}
if (url.pathname === "/api/providers") return json({ providers: [], presets: [], excluded: [], gateway: { running: true, window: true } });
if (url.pathname === "/api/usage/quotas") return json(quotas());
if (url.pathname === "/api/groups") return json({ groups: [], models: [] });
if (url.pathname === "/api/plugins") return json({ plugins: [] });
if (url.pathname.startsWith("/api/")) return json({});
const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); }
};
}
const words = {
en: { done: "Checked in today +50 · 3-day streak", off: "Auto check-in is off · last checked in 2026-09-30", wait: "Not checked in yet today · last checked in 2026-09-30", no: "Not eligible for the daily check-in", auto: "Auto check-in", now: "Check in now" },
zh: { done: "今日已签到 +50 · 连续 3 天", off: "自动签到已关闭 · 上次签到于 2026-09-30", wait: "今日尚未签到 · 上次签到于 2026-09-30", no: "不符合签到条件", auto: "自动签到", now: "立即签到" },
};
const scrolls = (page) => page.evaluate(() => [scrollY, ...[...document.querySelectorAll("*")].filter((e) => e.scrollTop).map((e) => e.scrollTop)].join(","));
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
for (const lang of ["en", "zh"]) {
const w = words[lang];
test(`${engine} ${lang}: the WorkBuddy card says how its check-in went`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 900, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", serve(lang, asked));
await page.goto("http://magpie.test/?view=usage");
const card = page.locator(".subscription-card", { hasText: "WorkBuddy" });
// every account in full, so each row is there to read
await card.locator(".wb-checkin").first().waitFor();
const rows = card.locator(".wb-checkin");
assert.equal(await rows.count(), 3, "one line an account");
const says = (await rows.locator(".ci-say").allInnerTexts()).map((s) => s.trim());
assert.deepEqual(says, [w.done, w.off, w.no]);
assert.deepEqual(await rows.evaluateAll((rs) => rs.map((r) => r.dataset.state)), ["ok", "none", "none"]);
assert.equal(await page.locator(".subscription-card", { hasText: "Codex" }).locator(".wb-checkin").count(), 0);
// the switch once, on the first row, off as Settings has it
const auto = card.locator(".ci-auto");
assert.equal(await auto.count(), 1);
assert.equal((await auto.innerText()).trim(), w.auto);
assert.equal(await auto.getAttribute("aria-pressed"), "false");
assert.equal(await card.locator(".ci-now").count(), 1, "韩梅梅 isn't in today");
if (process.env.ARTIFACT_DIR) await card.screenshot({ path: path.join(process.env.ARTIFACT_DIR, `usage-checkin-${engine}-${lang}.png`) });
// turned on from the card: saved as Settings' is, the page left where it was
const y = await scrolls(page);
await auto.click();
await page.waitForFunction(() => document.querySelector(".ci-auto")?.getAttribute("aria-pressed") === "true");
assert.deepEqual(asked, [["set", { on: true }]]);
assert.equal(await scrolls(page), y, "the toggle moved the page");
assert.equal((await rows.nth(1).locator(".ci-say").innerText()).trim(), w.wait);
assert.equal(await rows.nth(1).getAttribute("data-state"), "wait");
// Check in now presses it, and the cards are read again
const before = asked.length;
const reread = page.waitForRequest((r) => new URL(r.url()).pathname === "/api/usage/quotas");
await card.locator(".ci-now").click();
await reread;
assert.deepEqual(asked.slice(before), [["now"]]);
assert.equal(await page.locator("select").count(), 0);
assert.deepEqual(errors, []);
});
test(`${engine} ${lang}: the Trae CN card has its own check-in`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 900, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", serve(lang, asked));
await page.goto("http://magpie.test/?view=usage");
const card = page.locator(".subscription-card", { hasText: "Trae CN" });
await card.locator(".wb-checkin").first().waitFor();
assert.equal(await card.locator(".wb-checkin").count(), 1);
assert.equal((await card.locator(".ci-say").innerText()).trim(), lang === "en" ? "Auto check-in is off · last checked in 2026-09-30" : "自动签到已关闭 · 上次签到于 2026-09-30");
assert.match(await card.locator(".ci-say").getAttribute("title"), /Trae/);
// its own switch and press, beside WorkBuddy's
assert.equal(await page.locator(".ci-auto").count(), 4);
const auto = card.locator(".ci-auto");
assert.equal((await auto.innerText()).trim(), w.auto);
assert.match(await auto.getAttribute("title"), /Trae CN/);
const y = await scrolls(page);
await auto.click();
await page.waitForFunction(() => document.querySelectorAll(".ci-auto[aria-pressed=true]").length === 1);
assert.equal(await auto.getAttribute("aria-pressed"), "true");
assert.deepEqual(asked, [["trae-set", { on: true }]]);
assert.equal(await scrolls(page), y, "the toggle moved the page");
assert.equal(await page.locator(".subscription-card", { hasText: "WorkBuddy" }).locator(".ci-auto").getAttribute("aria-pressed"), "false", "WorkBuddy's switch changed too");
const before = asked.length;
const reread = page.waitForRequest((r) => new URL(r.url()).pathname === "/api/usage/quotas");
await card.locator(".ci-now").click();
await reread;
assert.deepEqual(asked.slice(before), [["trae-now"]]);
assert.deepEqual(errors, []);
});
// #808: Trae CN answers a claim from magpie 9074 for good, since it
// pays only its own app; the card says to check in there, offers no
// Check in now, and the Settings tab's line says the same.
test(`${engine} ${lang}: a Trae CN check-in only its own app gets says to check in in Trae CN`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 440, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [];
page.on("pageerror", (e) => errors.push(e.message));
const own = { user: "hu", by: "trae", day: today, outcome: "own-app", msg: "当前参与用户太多,请稍后再试" };
const says = lang === "en"
? "Trae CN only gives check-in credits to its own app; check in in the Trae CN app"
: "Trae CN 只给自己的客户端发签到积分,请在 Trae CN App 里签到";
await page.route("**/*", async (route) => {
const url = new URL(route.request().url());
if (url.pathname === "/api/usage/quotas") {
return route.fulfill({ json: quotas().map((q) => q.provider === "trae-cn" ? { ...q, checkin: own } : q) });
}
const settings = { theme: "light", lang, trae: true, traeCheckin: true, traeCheckins: [own] };
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [], profiles: [], settings } });
if (url.pathname === "/api/settings") return route.fulfill({ json: settings });
return serve(lang, [])(route);
});
await page.goto("http://magpie.test/?view=usage");
const card = page.locator(".subscription-card", { hasText: "Trae CN" });
await card.locator(".wb-checkin").first().waitFor();
assert.equal((await card.locator(".ci-say").innerText()).trim(), says);
assert.equal(await card.locator(".wb-checkin").getAttribute("data-state"), "none");
assert.match(await card.locator(".ci-say").getAttribute("title"), /当前参与用户太多/);
assert.equal(await card.locator(".ci-now").count(), 0, "a press would only claim again");
await page.goto("http://magpie.test/?view=settings&tab=usage");
await page.locator("#traeCheckinSub").waitFor({ state: "attached" });
const sub = await page.locator("#traeCheckinSub").textContent();
assert.ok(sub.includes("hu" + (lang === "en" ? ": " : ":") + says), sub);
assert.deepEqual(errors, []);
});
test(`${engine} ${lang}: the MiniMax Code card has its own check-in`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 900, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", serve(lang, asked));
await page.goto("http://magpie.test/?view=usage");
const card = page.locator(".subscription-card", { hasText: "MiniMax Code" });
await card.locator(".wb-checkin").first().waitFor();
assert.equal(await card.locator(".wb-checkin").count(), 1);
assert.equal((await card.locator(".ci-say").innerText()).trim(), lang === "en" ? "Auto check-in is off · last checked in 2026-10-04" : "自动签到已关闭 · 上次签到于 2026-10-04");
assert.match(await card.locator(".ci-say").getAttribute("title"), /MiniMax Code/);
const auto = card.locator(".ci-auto");
assert.match(await auto.getAttribute("title"), /MiniMax Code/);
const y = await scrolls(page);
await auto.click();
await page.waitForFunction(() => document.querySelectorAll(".ci-auto[aria-pressed=true]").length === 1);
assert.equal(await auto.getAttribute("aria-pressed"), "true");
assert.deepEqual(asked, [["mm-set", { on: true }]]);
assert.equal(await scrolls(page), y, "the toggle moved the page");
assert.equal(await page.locator(".subscription-card", { hasText: "Trae CN" }).locator(".ci-auto").getAttribute("aria-pressed"), "false", "Trae's switch changed too");
const before = asked.length;
const reread = page.waitForRequest((r) => new URL(r.url()).pathname === "/api/usage/quotas");
await card.locator(".ci-now").click();
await reread;
assert.deepEqual(asked.slice(before), [["mm-now"]]);
assert.deepEqual(errors, []);
});
test(`${engine} ${lang}: Settings has a MiniMax Code check-in tab`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 900, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", async (route) => {
const url = new URL(route.request().url());
const settings = { theme: "light", lang, minimax: true, minimaxCheckin: false,
minimaxCheckins: [{ user: "mm", by: "minimax", day: today, outcome: "claimed", credit: 800, streak: 2 }] };
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [], profiles: [], settings } });
if (url.pathname === "/api/settings" && route.request().method() === "POST") {
asked.push(route.request().postDataJSON().minimaxCheckin);
return route.fulfill({ json: { ...settings, minimaxCheckin: true } });
}
if (url.pathname === "/api/settings") return route.fulfill({ json: settings });
return serve(lang, [])(route);
});
await page.goto("http://magpie.test/?view=settings&tab=usage");
const tab = page.locator("#warmTab-minimax");
await tab.waitFor();
assert.equal(await tab.isHidden(), false);
await tab.click();
await page.locator("#minimaxList").waitFor();
assert.match(await page.locator("#minimaxCheckinSub").innerText(), /MiniMax Code/);
const saved = page.waitForRequest((r) => new URL(r.url()).pathname === "/api/settings" && r.method() === "POST");
await page.locator("#minimaxCheckinSegs button").nth(1).click();
await saved;
assert.deepEqual(asked, [true]);
assert.deepEqual(errors, []);
});
test(`${engine} ${lang}: the Qoder card has its own check-in`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 900, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", serve(lang, asked));
await page.goto("http://magpie.test/?view=usage");
const card = page.locator(".subscription-card", { hasText: "arno" });
await card.locator(".wb-checkin").first().waitFor();
assert.equal(await card.locator(".wb-checkin").count(), 1);
assert.equal((await card.locator(".ci-say").innerText()).trim(), lang === "en" ? "Auto check-in is off · last checked in 2026-10-05" : "自动签到已关闭 · 上次签到于 2026-10-05");
assert.match(await card.locator(".ci-say").getAttribute("title"), /Qoder/);
const auto = card.locator(".ci-auto");
assert.match(await auto.getAttribute("title"), /Qoder/);
const y = await scrolls(page);
await auto.click();
await page.waitForFunction(() => document.querySelectorAll(".ci-auto[aria-pressed=true]").length === 1);
assert.equal(await auto.getAttribute("aria-pressed"), "true");
assert.deepEqual(asked, [["qd-set", { on: true }]]);
assert.equal(await scrolls(page), y, "the toggle moved the page");
assert.equal(await page.locator(".subscription-card", { hasText: "MiniMax Code" }).locator(".ci-auto").getAttribute("aria-pressed"), "false", "MiniMax's switch changed too");
const before = asked.length;
const reread = page.waitForRequest((r) => new URL(r.url()).pathname === "/api/usage/quotas");
await card.locator(".ci-now").click();
await reread;
assert.deepEqual(asked.slice(before), [["qd-now"]]);
assert.deepEqual(errors, []);
});
test(`${engine} ${lang}: Settings has a Qoder check-in tab`, async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
const page = await (await browser.newContext({ viewport: { width: 440, height: 900 }, reducedMotion: "reduce" })).newPage();
page.setDefaultTimeout(5000);
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", async (route) => {
const url = new URL(route.request().url());
const settings = { theme: "light", lang, qoder: true, qoderCheckin: false,
qoderCheckins: [{ user: "arno", by: "qoder", day: today, outcome: "claimed", credit: 100 }] };
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [], profiles: [], settings } });
if (url.pathname === "/api/settings" && route.request().method() === "POST") {
asked.push(route.request().postDataJSON().qoderCheckin);
return route.fulfill({ json: { ...settings, qoderCheckin: true } });
}
if (url.pathname === "/api/settings") return route.fulfill({ json: settings });
return serve(lang, [])(route);
});
await page.goto("http://magpie.test/?view=settings&tab=usage");
const tab = page.locator("#warmTab-qoder");
await tab.waitFor();
assert.equal(await tab.isHidden(), false);
assert.equal(await page.locator("#warmTab-minimax").isHidden(), true, "MiniMax's tab with no MiniMax account");
// at 440x900 the tabs are below the fold: the reader scrolls to them
// with the wheel (a scroll of the script's own is put back, by design)
await page.mouse.move(220, 400);
for (let i = 0; i < 10; i++) {
const r = await tab.boundingBox(), foot = await page.locator("footer.foot").boundingBox();
if (r.y + r.height < foot.y - 8) break;
await page.mouse.wheel(0, 200);
await page.waitForTimeout(100);
}
await tab.click();
await page.locator("#qoderList").waitFor();
const sub = await page.locator("#qoderCheckinSub").innerText();
assert.match(sub, /Qoder/);
assert.match(sub, /arno/);
const box = await page.locator("#qoderCheckinRow").boundingBox();
assert(box.width > 0 && box.x + box.width <= 440, "the row fits at 440px");
const saved = page.waitForRequest((r) => new URL(r.url()).pathname === "/api/settings" && r.method() === "POST");
await page.locator("#qoderCheckinSegs button").nth(1).click();
await saved;
assert.deepEqual(asked, [true]);
assert.deepEqual(errors, []);
});
}
}