From 85678d927ac6241fafb8223f4e41e9dfa12a63f3 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 4 Dec 2026 15:55:42 -0500 Subject: [PATCH] test(input): a short wide binder keeps its drawing and every control reachable --- .../droiddeck/launcher/ui/InputSettingsTest.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/test/java/com/droiddeck/launcher/ui/InputSettingsTest.kt b/app/src/test/java/com/droiddeck/launcher/ui/InputSettingsTest.kt index 44e6399dd5..017356dd16 100644 --- a/app/src/test/java/com/droiddeck/launcher/ui/InputSettingsTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/ui/InputSettingsTest.kt @@ -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({}) } }