Fix hidden root navigation and browser fill matching
This commit is contained in:
@@ -5192,6 +5192,37 @@ func TestUIShowEntriesSectionRestoresHiddenRootAfterLeavingEntries(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUISyncCurrentPathNormalizesHiddenRootAfterSectionSwitch(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithModel("desktop", vault.Model{
|
||||
Entries: []vault.Entry{
|
||||
{ID: "1", Title: "Vault Console", Path: []string{"keepass", "Crew", "Internet"}},
|
||||
},
|
||||
Groups: [][]string{
|
||||
{"keepass"},
|
||||
{"keepass", "Crew"},
|
||||
{"Recycle Bin"},
|
||||
},
|
||||
})
|
||||
|
||||
u.showEntriesSection()
|
||||
u.showAPITokensSection()
|
||||
u.state.Section = appstate.SectionEntries
|
||||
u.state.CurrentPath = []string{"Root"}
|
||||
u.currentPath = nil
|
||||
u.syncedPath = nil
|
||||
|
||||
u.syncCurrentPath()
|
||||
|
||||
if got := u.currentPath; !slices.Equal(got, []string{"keepass"}) {
|
||||
t.Fatalf("currentPath after syncCurrentPath() = %v, want [keepass]", got)
|
||||
}
|
||||
if got := u.displayPath(); len(got) != 0 {
|
||||
t.Fatalf("displayPath() after syncCurrentPath() = %v, want root slash path", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIShowEntriesSectionRestoresEntriesViewState(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user