From e2d38d4e169d8518438add6d26de839decb12793 Mon Sep 17 00:00:00 2001 From: Matysh Date: Thu, 1 Oct 2026 21:39:13 +0300 Subject: [PATCH] test: await warm navigation request before checking its authority (#762) Issue: #762 User-Visible: no --- demo/smoke_nav_persist.mjs | 6 +++++- docs/testing-notes/mutation-browser-guards.md | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/demo/smoke_nav_persist.mjs b/demo/smoke_nav_persist.mjs index daedc311..bfae57bc 100644 --- a/demo/smoke_nav_persist.mjs +++ b/demo/smoke_nav_persist.mjs @@ -12,7 +12,11 @@ const res = await page.evaluate(async () => { c._setMode = (...args) => { resumedThroughSetMode += 1; return realSetMode(...args); }; c._pendingNavMode = 'devices'; c._serverCanWrite = true; - out.pendingModeUsesTransitionAuthority = c._resumePendingNavMode() === true + const pendingAccepted = c._resumePendingNavMode(); + // Both loaded and delayed runtimes now cross the same async request boundary. + // Observe the next rendered frame, still requiring exactly one real authority call. + await new Promise((resolve) => requestAnimationFrame(resolve)); await c.updateComplete; + out.pendingModeUsesTransitionAuthority = pendingAccepted === true && resumedThroughSetMode === 1 && c._mode === 'devices' && c._pendingNavMode == null; delete c._setMode; c._setMode('view', false); await c.updateComplete; diff --git a/docs/testing-notes/mutation-browser-guards.md b/docs/testing-notes/mutation-browser-guards.md index 429c21f2..23bdc941 100644 --- a/docs/testing-notes/mutation-browser-guards.md +++ b/docs/testing-notes/mutation-browser-guards.md @@ -17,8 +17,8 @@ to prove that the Node witness actually kills it. | Paint, cascade and layer composition | 26 | The invariant depends on computed CSS, SVG paint, clipping, stacking or pixels produced by Chromium. | | Pointer geometry and trusted interaction | 45 | The invariant depends on hit testing, pointer capture, touch/keyboard dispatch or live DOM geometry. | | Responsive DOM layout | 38 | The invariant depends on measured element boxes, responsive breakpoints, native/HA dialog shells or focusable target size. | -| Custom-element and HA browser lifecycle | 96 | The invariant crosses Lit/custom-element lifecycle, browser storage/events, lazy loading or a complete HA-card state transition. | -| **Total** | **213 / 200** | Above the guideline `mutation-gate --check` warns rather than fails (#699); each guard above it is held by its own reason in this inventory and its `because`. | +| Custom-element and HA browser lifecycle | 97 | The invariant crosses Lit/custom-element lifecycle, browser storage/events, lazy loading or a complete HA-card state transition. | +| **Total** | **214 / 200** | Above the guideline `mutation-gate --check` warns rather than fails (#699); each guard above it is held by its own reason in this inventory and its `because`. | ## Measured effect