Guard phone theme setup before the document root exists

Keep all browser error and geometry assertions; theme setup must tolerate the early WebKit init-script phase. The existing post-load dark-context assertion setup remains unchanged.

Change-source: pulse-maintainer
This commit is contained in:
pulse-triage[bot]
2026-10-04 12:05:19 +01:00
parent 3970960d31
commit 691ced6926
@@ -52,7 +52,7 @@ const runtime = [
hasTouch: phone,
colorScheme: phone ? 'dark' : 'light',
});
if (phone) await page.addInitScript(() => document.documentElement.classList.add('dark'));
if (phone) await page.addInitScript(() => document.documentElement?.classList.add('dark'));
page.setDefaultTimeout(20000);
await page.clock.setFixedTime(new Date('2026-10-04T12:00:00Z'));
const errors = [],