Skip to content

Commit 6f2bab6

Browse files
committed
test(ui): check full-height drawer bounds and responsive width
1 parent fabc6a6 commit 6f2bab6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎app/src/androidTest/java/com/system/location/service/UiDesignTest.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,12 @@ class UiDesignTest {
294294
compose.waitForIdle()
295295
val drawer = compose.onNodeWithTag("portal_drawer").assertIsDisplayed().fetchSemanticsNode().boundsInRoot
296296
val title = compose.onNodeWithText("Portal").fetchSemanticsNode().boundsInRoot
297+
val shell = compose.onNodeWithTag("portal_shell").fetchSemanticsNode().boundsInRoot
297298
val density = instrumentation.targetContext.resources.displayMetrics.density
298-
assertTrue("Compact drawer must respect the top safe area", drawer.top >= 12f * density)
299+
assertTrue("Drawer background must reach the top edge", kotlin.math.abs(drawer.top - shell.top) <= 1f)
300+
assertTrue("Drawer background must reach the bottom edge", kotlin.math.abs(drawer.bottom - shell.bottom) <= 1f)
299301
assertTrue("Compact drawer must stay within its width limit", drawer.width <= 288f * density + 1f)
300-
assertTrue("Compact drawer must stay within its height limit", drawer.height <= 600f * density + 1f)
302+
assertTrue("Drawer must leave room beside the menu", drawer.width <= shell.width * .78f + 1f)
301303
assertTrue("Drawer title needs safe space", title.top >= drawer.top)
302304
capture("drawer-$suffix")
303305
scenario.onActivity { it.closeDrawer() }

0 commit comments

Comments
 (0)