Restore approved picker Settings centring

This commit is contained in:
justinzeus 2026-11-07 19:38:53 +01:00
parent a27e922675
commit 7c67596cb6
4 changed files with 24 additions and 11 deletions

View file

@ -49,16 +49,17 @@ class PickerNavigationTest {
}
}
@Test fun settingsGearIsCenteredUnderTheFinalAvatarForAnyProfileCount() {
@Test fun settingsGearIsCenteredUnderTheWholePeopleRowForAnyProfileCount() {
val state = ShellState(fixturePeople(), "justin")
rule.setContent { WolfskinTheme { ShellSurface(state) } }
for (count in 1..5) {
val people = (0 until count).map { ShellPerson("person-$it", "Person $it", "$it", false) }
rule.runOnIdle { state.updatePeople(people); state.gearFocused = true }
rule.mainClock.advanceTimeBy(400)
val first = rule.onNodeWithTag("picker-person:${people.first().key}").fetchSemanticsNode().boundsInRoot
val last = rule.onNodeWithTag("picker-person:${people.last().key}").fetchSemanticsNode().boundsInRoot
val gear = rule.onNodeWithTag("picker-settings").fetchSemanticsNode().boundsInRoot
assertEquals("Settings must stay under the last profile for $count people", last.center.x, gear.center.x, .1f)
assertEquals("Settings must stay centred under the whole row for $count people", (first.center.x + last.center.x) / 2, gear.center.x, .1f)
assertTrue("Settings must be below the avatars", gear.top > last.bottom)
}
}