test: align rebased path coverage with controller state
This commit is contained in:
+8
-7
@@ -69,7 +69,7 @@ func TestUISearchBehaviorIsConsistentAcrossDesktopAndPhoneLayouts(t *testing.T)
|
|||||||
})
|
})
|
||||||
|
|
||||||
u.showEntriesSection()
|
u.showEntriesSection()
|
||||||
u.currentPath = []string{"Root", "Internet"}
|
u.state.NavigateToPath([]string{"Root", "Internet"})
|
||||||
u.search.SetText("climate")
|
u.search.SetText("climate")
|
||||||
u.filter()
|
u.filter()
|
||||||
if got := u.filteredTitles(); !slices.Equal(got, []string{"HVAC"}) {
|
if got := u.filteredTitles(); !slices.Equal(got, []string{"HVAC"}) {
|
||||||
@@ -77,7 +77,7 @@ func TestUISearchBehaviorIsConsistentAcrossDesktopAndPhoneLayouts(t *testing.T)
|
|||||||
}
|
}
|
||||||
|
|
||||||
u.showTemplatesSection()
|
u.showTemplatesSection()
|
||||||
u.currentPath = []string{"Templates", "Web"}
|
u.state.NavigateToPath([]string{"Templates", "Web"})
|
||||||
u.search.SetText("infra")
|
u.search.SetText("infra")
|
||||||
u.filter()
|
u.filter()
|
||||||
if got := u.filteredTitles(); !slices.Equal(got, []string{"SSH Login"}) {
|
if got := u.filteredTitles(); !slices.Equal(got, []string{"SSH Login"}) {
|
||||||
@@ -112,7 +112,7 @@ func TestUIClearingSearchResetsToCurrentSectionListing(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
u.showTemplatesSection()
|
u.showTemplatesSection()
|
||||||
u.currentPath = []string{"Templates", "Web"}
|
u.state.NavigateToPath([]string{"Templates", "Web"})
|
||||||
u.search.SetText("ssh")
|
u.search.SetText("ssh")
|
||||||
u.filter()
|
u.filter()
|
||||||
if got := u.filteredTitles(); !slices.Equal(got, []string{"SSH Login"}) {
|
if got := u.filteredTitles(); !slices.Equal(got, []string{"SSH Login"}) {
|
||||||
@@ -873,7 +873,7 @@ func TestUICreatesEntryWithAllSupportedEditorFields(t *testing.T) {
|
|||||||
|
|
||||||
u := newUIWithModel("desktop", vault.Model{})
|
u := newUIWithModel("desktop", vault.Model{})
|
||||||
u.showEntriesSection()
|
u.showEntriesSection()
|
||||||
u.currentPath = []string{"Root", "Internet"}
|
u.state.NavigateToPath([]string{"Root", "Internet"})
|
||||||
u.filter()
|
u.filter()
|
||||||
|
|
||||||
u.entryID.SetText("bellagio")
|
u.entryID.SetText("bellagio")
|
||||||
@@ -929,7 +929,7 @@ func TestUIEditingEntryPathMovesEntryBetweenGroups(t *testing.T) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
u.showEntriesSection()
|
u.showEntriesSection()
|
||||||
u.currentPath = []string{"Root", "Internet"}
|
u.state.NavigateToPath([]string{"Root", "Internet"})
|
||||||
u.filter()
|
u.filter()
|
||||||
u.state.SelectedEntryID = "vault-console"
|
u.state.SelectedEntryID = "vault-console"
|
||||||
u.loadSelectedEntryIntoEditor()
|
u.loadSelectedEntryIntoEditor()
|
||||||
@@ -939,18 +939,19 @@ func TestUIEditingEntryPathMovesEntryBetweenGroups(t *testing.T) {
|
|||||||
t.Fatalf("saveEntryAction() move error = %v", err)
|
t.Fatalf("saveEntryAction() move error = %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
u.currentPath = []string{"Root", "Internet"}
|
u.state.NavigateToPath([]string{"Root", "Internet"})
|
||||||
u.filter()
|
u.filter()
|
||||||
if got := u.filteredTitles(); len(got) != 0 {
|
if got := u.filteredTitles(); len(got) != 0 {
|
||||||
t.Fatalf("filteredTitles() in old path = %v, want empty after move", got)
|
t.Fatalf("filteredTitles() in old path = %v, want empty after move", got)
|
||||||
}
|
}
|
||||||
|
|
||||||
u.currentPath = []string{"Root", "Infrastructure"}
|
u.state.NavigateToPath([]string{"Root", "Infrastructure"})
|
||||||
u.filter()
|
u.filter()
|
||||||
if got := u.filteredTitles(); !slices.Equal(got, []string{"Vault Console"}) {
|
if got := u.filteredTitles(); !slices.Equal(got, []string{"Vault Console"}) {
|
||||||
t.Fatalf("filteredTitles() in new path = %v, want [Vault Console]", got)
|
t.Fatalf("filteredTitles() in new path = %v, want [Vault Console]", got)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u.state.SelectedEntryID = "vault-console"
|
||||||
item, ok := u.selectedEntry()
|
item, ok := u.selectedEntry()
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatal("selectedEntry() ok = false, want moved entry")
|
t.Fatal("selectedEntry() ok = false, want moved entry")
|
||||||
|
|||||||
Reference in New Issue
Block a user