@devries-cameron20 / t3code-1 / commits / 4836fa7938
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

test(web): make the favicon picker offscreen-preview test deterministic (#22174)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 19, 2026 at 23:38 UTC 4836fa793816bd65bb0e36171e8d75455b0f82cc
1 file changed +7 -2
apps/web/src/components/settings/ProjectFaviconPickerDialog.browser.test.tsx
+7 -2
@@ -166,9 +166,14 @@ async function publishUrl(path: string, url: string) {
166 });
167 }
168
169 +// Decoding sets naturalWidth before the load event reaches React, so wait for both together.
170 async function expectPreview(row: HTMLElement) {
170 - await expect.poll(() => row.querySelector("img")?.naturalWidth).toBe(8);
171 - expect(row.querySelector("svg")).toBeNull();
171 + await expect
172 + .poll(() => ({
173 + width: row.querySelector("img")?.naturalWidth,
174 + fallback: row.querySelector("svg") !== null,
175 + }))
176 + .toEqual({ width: 8, fallback: false });
177 }
178
179 it("loads previews asynchronously and only acquires offscreen images after scrolling", async () => {