Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

gui tests: plugin updates reads the sidebar's update label where it finds it (#3633, #3103)

yetoned248b3d2a9bb
diff --git a/internal/gui/tests/plugin-updates.test.cjs b/internal/gui/tests/plugin-updates.test.cjs
index 94b2b2c5f..b2d45a8b1 100644
--- a/internal/gui/tests/plugin-updates.test.cjs
+++ b/internal/gui/tests/plugin-updates.test.cjs
@@ -81,9 +81,20 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await up.waitFor();
assert.equal(await up.textContent(), w.one);
assert.match(await up.evaluate((e) => e.parentElement.textContent), new RegExp("^" + w.installed));
- assert.equal(await up.evaluate((e) => getComputedStyle(e).color), await page.evaluate(() => { const p = document.createElement("i"); p.style.color = "var(--accent)"; document.body.append(p); const c = getComputedStyle(p).color; p.remove(); return c; }), "in the dot's colour");
- const box = await up.evaluate((e) => { const r = e.getBoundingClientRect(), b = e.parentElement.getBoundingClientRect(); return r.right <= b.right + 0.5 && r.left >= b.left; });
- assert.ok(box, "the label fits its row");
+ // read where it is found, in one go: the rows are drawn again as
+ // the page's counts come in, so a label found a moment ago may be
+ // gone, and a gone one has no colour or box
+ const label = await page.evaluate(() => {
+ const e = document.querySelector(".nav-s em.up"), r = e.getBoundingClientRect(), b = e.parentElement.getBoundingClientRect();
+ const p = document.createElement("i");
+ p.style.color = "var(--accent)";
+ document.body.append(p);
+ const accent = getComputedStyle(p).color;
+ p.remove();
+ return { color: getComputedStyle(e).color, accent, fits: r.right <= b.right + 0.5 && r.left >= b.left };
+ });
+ assert.equal(label.color, label.accent, "in the dot's colour");
+ assert.ok(label.fits, "the label fits its row");
}
// the dot, followed, lands on Installed (the page was last on
// Discover), which names the plugins with an update first