diff --git a/e2e/tests/journeys.spec.ts b/e2e/tests/journeys.spec.ts index 07dfe10..e5d1efd 100644 --- a/e2e/tests/journeys.spec.ts +++ b/e2e/tests/journeys.spec.ts @@ -789,9 +789,21 @@ test('the brand asset set is complete and served', async ({ page }) => { expect(og.ok()).toBe(true); expect(og.headers()['content-type']).toContain('image/png'); - // iOS ignores SVG touch icons, so this must be a real raster. - const apple = await page.request.get('/apple-icon'); - expect(apple.ok()).toBe(true); + /* + * iOS ignores SVG touch icons, so this must be a real raster. + * + * Read the href off the page rather than hardcoding a path. The route moved + * when the generated app/apple-icon.tsx became a static app/apple-icon.png: + * a generated icon is served at /apple-icon, a static one at /apple-icon.png + * with a content hash. This test kept asking for /apple-icon and got a 404 — + * reporting a missing icon while the icon was present and correctly linked. + */ + const appleLink = page.locator('link[rel="apple-touch-icon"]'); + await expect(appleLink).toHaveCount(1); + const appleHref = await appleLink.getAttribute('href'); + expect(appleHref).toBeTruthy(); + const apple = await page.request.get(appleHref!); + expect(apple.ok(), `apple touch icon at ${appleHref} should be served`).toBe(true); expect(apple.headers()['content-type']).toContain('image/png'); // Android needs a maskable PNG or the install prompt has no icon. @@ -912,8 +924,22 @@ test('the header carries the schoolcompare lockup', async ({ page }) => { // hashed at build time and change on any unrelated edit. await expect(home).toHaveText(/^\s*schoolcompare\s*$/); - const mark = home.locator('svg').first(); + /* + * The mark is raster artwork, not an inline SVG — it has been since the + * supplied logo replaced the reconstruction, and this locator went on + * looking for an that no longer exists. + * + * Assert on naturalWidth rather than visibility: a whose sources + * all 404 still lays out and still passes toBeVisible(), so the weaker + * assertion would go green on a broken lockup. + */ + const mark = home.locator('img').first(); await expect(mark).toBeVisible(); + const markState = await mark.evaluate((el: HTMLImageElement) => ({ + loaded: el.complete && el.naturalWidth > 0, + src: el.currentSrc, + })); + expect(markState.loaded, `header mark failed to load: ${markState.src}`).toBe(true); }); test('no visible text falls back to the browser default black', async ({ page }) => {