From e1ca55f7cbae36af6e9b1576a11ccfe3ed73c4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 3 Sep 2026 14:59:28 +0300 Subject: [PATCH] The photo check navigates the way a person does The overlay checks drove /settings by document load alone; a script that only ran on full loads would have passed them all. The pass now also arrives by the topbar's soft navigation and by the live refresh's morph, and opens the viewer after each. --- crates/iz-web/tests/browser/photo.mjs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/iz-web/tests/browser/photo.mjs b/crates/iz-web/tests/browser/photo.mjs index abbe145..13e0572 100644 --- a/crates/iz-web/tests/browser/photo.mjs +++ b/crates/iz-web/tests/browser/photo.mjs @@ -186,6 +186,31 @@ if (!failures.length) { } } +// The everyday path: settings arrives by soft navigation, and by the live +// refresh's morph after it — not by document load. The swap re-creates the +// inline scripts and the morph preserves them; either going wrong passes +// every check above and dies for anyone who simply navigated. +if (!failures.length) { + await page.goto(base + '/', { waitUntil: 'networkidle' }); + await page.click('a[href="/settings"]'); + await page + .waitForFunction(() => location.pathname === '/settings', { timeout: 5000 }) + .catch(() => failures.push('the Settings nav click never soft-navigated')); + if (!failures.length && (await openViewer('soft-nav'))) { + await page.keyboard.press('Escape'); + await viewerGone('soft-nav'); + } +} +if (!failures.length) { + await page.evaluate(() => window.__izRefresh()); + // Sleeping is the measurement: the refresh lands without an event. + await page.waitForTimeout(800); + if (await openViewer('post-refresh')) { + await page.keyboard.press('Escape'); + await viewerGone('post-refresh'); + } +} + await browser.close(); note(`page errors ${errors.length ? errors.join(' | ') : 'none'}`);