Collapse phone subgroup browser after navigation
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user