Skip to content

Commit 2825079

Browse files
test(ui): stabilize dashboard stats polling test
The dashboard waits one second before polling for fresh stats, so the previous assertion could time out at the same boundary and fail intermittently. Giving the wait enough headroom keeps `bun run check` reliable. Co-Authored-By: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
1 parent 4dfd7ce commit 2825079

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

packages/ui/src/app/components/dashboard/PackageDashboardStats.test.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ describe("PackageDashboardStats", () => {
5757
});
5858
expect(screen.getByText("Refreshing stats...")).toBeDefined();
5959

60-
await waitFor(() => {
61-
const projectsLabel = screen.getByText("Projects");
62-
expect(projectsLabel.previousSibling?.textContent).toBe("7");
63-
});
64-
expect(getStatsCalls).toBeGreaterThanOrEqual(2);
65-
expect(screen.queryByText("Refreshing stats...")).toBeNull();
60+
await waitFor(
61+
() => {
62+
expect(getStatsCalls).toBeGreaterThanOrEqual(2);
63+
const projectsLabel = screen.getByText("Projects");
64+
expect(projectsLabel.previousSibling?.textContent).toBe("7");
65+
expect(screen.queryByText("Refreshing stats...")).toBeNull();
66+
},
67+
{ timeout: 2500 },
68+
);
6669
});
6770

6871
test("updates when the desktop host pushes refreshed stats", async () => {

0 commit comments

Comments
 (0)