Skip to content

Commit e921a0c

Browse files
committed
test(usage): assert retained window identity while loading
1 parent 38fd2b4 commit e921a0c

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎apps/web/src/state/usage.browser.test.tsx‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ function setup() {
5555
function UsageProbe({ window }: { readonly window: UsageSummaryInput }) {
5656
const usage = useUsage(window);
5757
return (
58-
<output>
59-
{usage.shown === null
60-
? "Loading usage"
61-
: `${usage.shown.window.resolution ?? "day"} usage: ${usage.selectedEnvironments[0]?.error ?? "ready"}`}
62-
</output>
58+
<>
59+
<output>
60+
{usage.shown === null
61+
? "Loading usage"
62+
: `${usage.shown.window.resolution ?? "day"} usage: ${usage.selectedEnvironments[0]?.error ?? "ready"}`}
63+
</output>
64+
<output>{usage.shown?.window.sinceDay ?? "No shown window"}</output>
65+
</>
6366
);
6467
}
6568

@@ -96,4 +99,5 @@ it("keeps the previous view while another window of the same resolution loads",
9699
<UsageProbe window={{ ...window, sinceDay: UsageDay.make("2026-10-01") }} />,
97100
);
98101
await expect.element(screen.getByText("day usage: ready")).toBeVisible();
102+
await expect.element(screen.getByText("2026-10-16")).toBeVisible();
99103
});

0 commit comments

Comments
 (0)