From 0c4dd78fd67eb114dcc1f59108d71cc597f1494b Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 3 Nov 2026 19:54:39 -0600 Subject: [PATCH] test(session-ui): ignore the story's own favicon in the favicon request check (#61545) --- packages/session-ui/component-tests/markdown.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/session-ui/component-tests/markdown.spec.ts b/packages/session-ui/component-tests/markdown.spec.ts index 7ac43062786..a7973de906f 100644 --- a/packages/session-ui/component-tests/markdown.spec.ts +++ b/packages/session-ui/component-tests/markdown.spec.ts @@ -389,8 +389,13 @@ story("keeps favicon space stable across loading and failure without fetching pr expect((await artwork(missing)).mask).toContain("data:image/svg+xml") await expect(markdown.getByRole("link", { name: "private" }).locator(".markdown-link-favicon img")).toHaveCount(0) await expect(markdown.getByRole("link", { name: "GitHub" }).locator(".markdown-link-favicon img")).toHaveCount(0) - // Routing disables the browser cache, so the loaded favicon's CSS artwork requests its URL again here. - expect(new Set(requested).size).toBe(2) + + // Routing disables the browser cache, so a loaded favicon's CSS artwork requests its URL again here. That includes + // the story's own example.com link, whose favicon can load before this route exists and its artwork after. + const domains = new Set(requested.map((url) => new URL(url).searchParams.get("domain"))) + domains.delete("example.com") + + expect(domains).toEqual(new Set(["developer.mozilla.org", "broken.example.org"])) expect(requested.every((url) => !url.includes("localhost") && !url.includes("github.com"))).toBe(true) })