From 86597a8b25be31b009c1c33d4c7649584df3d096 Mon Sep 17 00:00:00 2001 From: Badcuban <108198679+badcuban@users.noreply.github.com> Date: Fri, 20 Nov 2026 20:32:58 -0500 Subject: [PATCH] test(web): steady the usage bar pace test on busy CI machines The test checked that the usage popup was gone from the page after clicking a row. The popup leaves only after its fade-out, which needs animation frames. A busy CI tab can go seconds without drawing one, so the popup was still there when the check gave up. Check the meter button's aria-expanded instead. It turns false as soon as the row closes the popover, frames or not. --- .../web/src/components/chat/ContextWindowMeter.browser.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/chat/ContextWindowMeter.browser.tsx b/apps/web/src/components/chat/ContextWindowMeter.browser.tsx index e5cf3a3ff..8037c6ac4 100644 --- a/apps/web/src/components/chat/ContextWindowMeter.browser.tsx +++ b/apps/web/src/components/chat/ContextWindowMeter.browser.tsx @@ -137,7 +137,12 @@ describe("ContextWindowMeter", () => { await page.getByRole("button", { name: /Weekly 36% used, 14% of the window passed/ }).click(); expect(openUsage).toHaveBeenCalledTimes(1); - await expect.element(page.getByText("Codex usage")).not.toBeInTheDocument(); + // The row closes the popover. Checked on the meter's own state: the popup + // leaves the page only after its fade-out, which needs frames a busy CI + // tab may not draw for many seconds. + await expect + .element(page.getByRole("button", { name: /Context window/ })) + .toHaveAttribute("aria-expanded", "false"); } finally { await screen.unmount(); }