fix: Report media failures once per failure (#2666)

This commit is contained in:
Dermot Duffy
2026-08-09 10:48:17 -07:00
committed by GitHub
parent 8d8d486afa
commit 5e199b5612
22 changed files with 484 additions and 123 deletions
+9
View File
@@ -75,6 +75,15 @@ export const createUnansweredMediaURL = (): string => createTestMediaURL([]);
export const createStallingMediaURL = (filename?: string): string =>
createTestMediaURL([HTTP_OK], false, filename);
/**
* How many requests a media URL has been asked for, so a test can count what
* the card actually fetched rather than only what it displayed.
*/
export const getTestMediaRequestCount = (url: string): number => {
const token = new URL(url, window.location.href).searchParams.get('token');
return (token ? requestCounts.get(token) : null) ?? 0;
};
/**
* Serves a fixture at `/test-media/<file>`, behaving as the query asks:
*