Collapse phone subgroup browser after navigation

This commit is contained in:
Joe Julian
2026-04-02 09:41:33 -07:00
parent bbde2516a3
commit 689309f704
2 changed files with 84 additions and 4 deletions
+40
View File
@@ -734,6 +734,46 @@ func TestUIPhoneGroupBarWithChildGroupsDoesNotPanic(t *testing.T) {
_ = u.groupBar(gtx)
}
func TestUIPhoneGroupBrowserStartsExpandedAtRootAndCollapsesInVisibleSubgroups(t *testing.T) {
t.Parallel()
u := newUIWithModel("phone", vault.Model{
Groups: [][]string{
{"Joe"},
{"Joe", "Internet"},
},
})
u.setCurrentPath(nil)
if !u.phoneGroupBrowserExpanded {
t.Fatal("phoneGroupBrowserExpanded = false at root, want true")
}
u.setCurrentPath([]string{"Joe", "Internet"})
if u.phoneGroupBrowserExpanded {
t.Fatal("phoneGroupBrowserExpanded = true inside visible subgroup, want false")
}
}
func TestUIPhoneGroupBrowserToggleDoesNotChangeCurrentGroupToolsState(t *testing.T) {
t.Parallel()
u := newUIWithModel("phone", vault.Model{
Groups: [][]string{
{"Joe"},
{"Joe", "Internet"},
},
})
u.groupControlsHidden = true
u.setCurrentPath([]string{"Joe"})
u.phoneGroupBrowserExpanded = false
u.phoneGroupBrowserExpanded = !u.phoneGroupBrowserExpanded
if !u.groupControlsHidden {
t.Fatal("groupControlsHidden = false, want phone group browser toggle to stay independent")
}
}
func TestUIAPIAuditSectionShowsRecordedEvents(t *testing.T) {
t.Parallel()