From 9d8ed51fc36f15acac622818acdd1d7d6eba53c6 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 16:29:25 +0200 Subject: [PATCH] test(app): allow the shared usage clock minute phase The browser clock advances independently of daemon timestamps, and the shared ticker samples on wall-minute boundaries. Assert the bounded one-to-two-minute age and matching countdown progress instead of a single phase-dependent value. --- packages/app/e2e/browser/usage-modal.spec.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/app/e2e/browser/usage-modal.spec.ts b/packages/app/e2e/browser/usage-modal.spec.ts index 9a6a4734af..b680754da2 100644 --- a/packages/app/e2e/browser/usage-modal.spec.ts +++ b/packages/app/e2e/browser/usage-modal.spec.ts @@ -715,11 +715,15 @@ test("open usage clocks advance without refreshing or reopening", async ({ page const card = page.getByTestId("usage-report-login-journey:account"); await expect(card.getByTestId("usage-freshness")).toHaveText("Updated just now"); await expect(card.getByText("resets 30m", { exact: false }).first()).toBeVisible(); + // The shared minute clock is wall-aligned, and the daemon timestamps use real time. + // After two browser minutes the latest displayed tick is one or two minutes old. await advanceUsageClock(page, 120_000); - await expect(card.getByTestId("usage-freshness")).toHaveText("Updated 2m ago"); - await expect(card.getByText("resets 28m", { exact: false }).first()).toBeVisible(); - await expect(card.getByText("runs out 28m", { exact: false })).toBeVisible(); - await expect(card.getByTestId("provider-usage-balance-credits-reset")).toHaveText("resets 28m"); + await expect(card.getByTestId("usage-freshness")).toHaveText(/^Updated [12]m ago$/); + await expect(card.getByText(/resets (28|29)m/).first()).toBeVisible(); + await expect(card.getByText(/runs out (28|29)m/)).toBeVisible(); + await expect(card.getByTestId("provider-usage-balance-credits-reset")).toHaveText( + /^resets (28|29)m$/, + ); } finally { await login.cleanup(); }