Modern Apps git

← Modern-Apps.git

web: await observed shield level in panel test

Commit
37573aa7535be68c552a3140e3dac7df1f90b09f
Author
Vayun Mathur <[email protected]>
When
2026-11-17 02:44 UTC (19 days ago)
Parents
8d5f201
The shields panel writes the per-site override into a mirror that the Room shieldSettings collector clear-and-repopulates on every emission; an in-flight empty emission could clear the just-clicked Standard override until the upsert emission landed, so shieldsFor read AGGRESSIVE at the idle assert.

Await the observed STANDARD level via the test's existing await helper. Product behaviour unchanged.

Verified: TZ=UTC shieldsPanelLevelAndToggleInteractions green.

Diff

web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt
diff --git a/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt b/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.ktindex 15845dda0b..fdb6770996 100644--- a/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt+++ b/web/src/test/java/com/vayunmathur/web/ui/WebPagesDeepTest.kt@@ -227,6 +227,14 @@ class WebPagesDeepTest {         // Pick the Standard level via its radio row, then reload to apply.         rule.onNodeWithText("Standard").performClick()         rule.waitForIdle()+        // updateSiteShields mirrors synchronously, but the Room-backed+        // shieldSettings collector clears and repopulates that mirror on+        // every emission; an in-flight (initially empty) emission can+        // clear the just-set override until the upsert emission lands.+        // Await the observed level instead of asserting at idle.+        await("site shields apply") {+            v.shieldsFor("panel.example").level == com.vayunmathur.web.domain.ShieldLevel.STANDARD+        }         assertEquals(             com.vayunmathur.web.domain.ShieldLevel.STANDARD,             v.shieldsFor("panel.example").level,