mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 17:01:37 +03:00
test(session-ui): ignore the story's own favicon in the favicon request check (#61545)
This commit is contained in:
committed by
GitHub
Unverified
parent
4f271bcd15
commit
0c4dd78fd6
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user