Compare the repeat view's stylesheets in any order, since WebKit finishes cache hits in no set order

This commit is contained in:
2026-11-03 21:50:13 +01:00
parent 7100740eb5
commit 29fac748f9
+3 -1
View File
@@ -264,7 +264,9 @@ test("a repeat page view fetches no stylesheet again", async ({ page }) => {
await page.goto("/");
const repeat = await stylesheets();
expect(repeat.map(({ name }) => name)).toEqual(first.map(({ name }) => name));
// A cache hit completes in no set order, so the two views list the same files in any order.
const names = (entries: { name: string }[]): string[] => entries.map(({ name }) => name).sort();
expect(names(repeat)).toEqual(names(first));
for (const { name, transferSize } of repeat) expect(transferSize, `${name} on the repeat view`).toBe(0);
});