mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
Give the add-measurement journey the dashboard's budget, not the default one
It kept dying at thirty seconds on the quick-add trigger. The trigger was not the problem: the dashboard route segment suspends behind its server render and shows `loading.tsx` until that resolves, and on a shared runner with the whole suite in flight that has overrun the default test budget. Raising the locator timeout achieved nothing, because the test itself was the thing expiring. So the wait is now on the skeleton going away rather than on the network going quiet — `networkidle` says nothing about whether a suspended segment resolved — and the budget belongs to the page rather than to the default. Every assertion about the round trip stays exactly as tight as it was.
This commit is contained in:
1 parent
17a2ec3328
commit
10e113e537
1 file changed
+17
@@ -16,6 +16,16 @@ import { openMenu } from "./open-menu";
|
||||
test.describe("add measurement flow", () => {
|
||||
test.use({ storageState: STORAGE_STATE_PATH });
|
||||
|
||||
// This journey lands on the dashboard, which is the most expensive page in
|
||||
// the product to render cold: the route segment suspends behind the server
|
||||
// render and shows `loading.tsx` until it resolves. On a shared runner with
|
||||
// the whole suite in flight that has overrun the 30 s default, and the test
|
||||
// then died on the quick-add trigger rather than on anything it is about.
|
||||
// The subject here is the add-then-appears round trip, not the dashboard's
|
||||
// cold-start latency, so the budget is the page's and the assertions stay
|
||||
// exactly as tight as they were.
|
||||
test.setTimeout(90_000);
|
||||
|
||||
test("creating a weight reading surfaces it in the list", async ({
|
||||
page,
|
||||
}) => {
|
||||
@@ -104,6 +114,13 @@ test.describe("add measurement flow", () => {
|
||||
);
|
||||
|
||||
await page.goto("/", { waitUntil: "domcontentloaded" });
|
||||
// Past the route-level skeleton first. `networkidle` says nothing about
|
||||
// whether the suspended segment resolved, and every locator below lives
|
||||
// inside the content that replaces it.
|
||||
await expect(page.locator('[data-slot="dashboard-loading"]')).toHaveCount(
|
||||
0,
|
||||
{ timeout: 60_000 },
|
||||
);
|
||||
await page.waitForLoadState("networkidle");
|
||||
|
||||
// Open the "Add" dropdown — the dashboard's quick-entry trigger sits
|
||||
|
||||
Reference in new issue
Block a user