test(input): a short wide binder keeps its drawing and every control reachable

This commit is contained in:
Kurt Himebauch committed 2026-12-04 15:55:42 -05:00
1 parent e0315e5b66
commit 85678d927a
1 file changed
+17
@@ -505,6 +505,23 @@ class InputSettingsTest {
}
}
@Test @Config(qualifiers = "w960dp-h400dp-land")
fun aShortWideBinderKeepsItsDrawingAndEveryControlReachable() {
InputLibraries.update(context) { l ->
val id = l.profile(InputProfile.GAME).binding(InputRole.PHYSICAL)
l.withPreset(l.preset(id).let { p -> p.copy(controls = p.controls + listOf(InputControl.A, InputControl.B, InputControl.X, InputControl.Y,
InputControl.LB, InputControl.RB).associateWith { InputAction.Keys(listOf(57)) }) })
}
compose.setContent { DroidDeckTheme { InputSettingsPage({}) } }
compose.onNodeWithTag("input-profile-game").performScrollTo().performClick()
compose.onNodeWithTag("input-part-physical").performScrollTo().performClick()
compose.onNodeWithTag("input-buttons-changed").assertExists()
val pad = compose.onNodeWithTag("input-buttons-pad").fetchSemanticsNode().boundsInRoot
assertTrue("drawing height ${pad.height}", pad.height >= 180f * context.resources.displayMetrics.density - 1f)
compose.onNodeWithTag("input-other-right-click").performScrollTo().performClick()
compose.onAllNodesWithText(InputControl.RIGHT_CLICK.label, substring = false).assertCountEquals(2)
}
@Test fun theProfilePageSetsWhatItIsTheDefaultFor() {
InputLibraries.update(context) { it.duplicateProfile(InputProfile.GAME, "Racing", "racing") }
compose.setContent { DroidDeckTheme { InputSettingsPage({}) } }