From f6850973bc6e93b7d50ce61319de76ef76a35c16 Mon Sep 17 00:00:00 2001 From: Gerard Louis Recinto Date: Mon, 5 Oct 2026 13:11:49 -0700 Subject: [PATCH] test that nothing covers the homepage hero when the icon CDN is unreachable The boot overlay used to stay up for good if the icon script failed to load, which left the homepage a black screen that still returned 200. This blocks unpkg.com and checks the headline is the topmost element at its own position. It fails on the homepage from before #507. --- tests/homepage.spec.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/homepage.spec.ts b/tests/homepage.spec.ts index 279c7e8a3..9e8f548e1 100644 --- a/tests/homepage.spec.ts +++ b/tests/homepage.spec.ts @@ -23,6 +23,27 @@ test.describe('Homepage', () => { expect(fits, 'the headline fits the viewport').toBe(true); }); + test('nothing covers the hero when the icon CDN is unreachable', async ({ page }) => { + // The boot overlay once stayed up for good after the icon script failed to load, + // and the homepage was a black screen that still answered 200. + await page.route(/unpkg\.com/, (route) => route.abort()); + await page.goto('/', { waitUntil: 'load' }); + const h1 = page.getByRole('heading', { level: 1 }); + await expect(h1).toBeVisible(); + await expect + .poll( + () => + page.evaluate(() => { + const el = document.querySelector('h1')!; + const r = el.getBoundingClientRect(); + const top = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2); + return !!top && el.contains(top); + }), + { message: 'the headline is the topmost element at its own position', timeout: 15_000 }, + ) + .toBe(true); + }); + test('hero shows the blocked then allowed sequence', async ({ page }) => { await page.goto('/', { waitUntil: 'domcontentloaded' }); const ex = page.locator('#hero-example');