Clarify group navigation and management
This commit is contained in:
@@ -1420,6 +1420,37 @@ func TestUIGroupControlsCanBeCollapsed(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIGroupNavigationLabelsDistinguishRootCurrentAndParent(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithModel("desktop", vault.Model{
|
||||
Groups: [][]string{{"Root"}, {"Root", "Infrastructure"}, {"Root", "Infrastructure", "Prod"}},
|
||||
})
|
||||
u.showEntriesSection()
|
||||
|
||||
if got := u.currentGroupDisplayName(); got != "Vault root (/)" {
|
||||
t.Fatalf("currentGroupDisplayName() at root = %q, want %q", got, "Vault root (/)")
|
||||
}
|
||||
if got := u.parentGroupDisplayName(); got != "Vault root (/)" {
|
||||
t.Fatalf("parentGroupDisplayName() at root = %q, want %q", got, "Vault root (/)")
|
||||
}
|
||||
if got := u.createGroupLabel(); got != "Create Top-Level Group" {
|
||||
t.Fatalf("createGroupLabel() at root = %q, want %q", got, "Create Top-Level Group")
|
||||
}
|
||||
|
||||
u.setCurrentPath([]string{"Root", "Infrastructure", "Prod"})
|
||||
|
||||
if got := u.currentGroupDisplayName(); got != "Infrastructure / Prod" {
|
||||
t.Fatalf("currentGroupDisplayName() = %q, want %q", got, "Infrastructure / Prod")
|
||||
}
|
||||
if got := u.parentGroupDisplayName(); got != "Infrastructure" {
|
||||
t.Fatalf("parentGroupDisplayName() = %q, want %q", got, "Infrastructure")
|
||||
}
|
||||
if got := u.createGroupLabel(); got != "Create Subgroup" {
|
||||
t.Fatalf("createGroupLabel() = %q, want %q", got, "Create Subgroup")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIParentGroupShowsDescendantEntries(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -2965,6 +2996,7 @@ func TestUILoadingDetailMessageUsesSelectedVault(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithSession("desktop", &session.Manager{})
|
||||
u.lifecycleMode = "local"
|
||||
u.vaultPath.SetText("/home/julian/vaults/main.kdbx")
|
||||
u.loadingMessage = "Open vault..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user