test: align template UI coverage with controller navigation
This commit is contained in:
+6
-4
@@ -1064,7 +1064,7 @@ func TestUITemplatesCanBeBrowsedCreatedEditedDeletedAndInstantiated(t *testing.T
|
||||
t.Fatalf("childGroups() = %v, want [Infra] at template root", got)
|
||||
}
|
||||
|
||||
u.currentPath = []string{"Templates", "Infra"}
|
||||
u.state.NavigateToPath([]string{"Templates", "Infra"})
|
||||
u.filter()
|
||||
if got := u.filteredTitles(); !slices.Equal(got, []string{"SSH Login"}) {
|
||||
t.Fatalf("filteredTitles() = %v, want [SSH Login] in template path", got)
|
||||
@@ -1083,12 +1083,13 @@ func TestUITemplatesCanBeBrowsedCreatedEditedDeletedAndInstantiated(t *testing.T
|
||||
t.Fatalf("saveTemplateAction(create) error = %v", err)
|
||||
}
|
||||
|
||||
u.currentPath = []string{"Templates", "Web"}
|
||||
u.state.NavigateToPath([]string{"Templates", "Web"})
|
||||
u.filter()
|
||||
if got := u.filteredTitles(); !slices.Equal(got, []string{"Website Login"}) {
|
||||
t.Fatalf("filteredTitles() after create = %v, want [Website Login]", got)
|
||||
}
|
||||
|
||||
u.state.SelectedEntryID = "tpl-web"
|
||||
u.loadSelectedEntryIntoEditor()
|
||||
u.entryTitle.SetText("Website Login Updated")
|
||||
u.entryFields.SetText("Environment=prod")
|
||||
@@ -1119,8 +1120,9 @@ func TestUITemplatesCanBeBrowsedCreatedEditedDeletedAndInstantiated(t *testing.T
|
||||
}
|
||||
|
||||
u.showEntriesSection()
|
||||
u.currentPath = []string{"Root", "Internet"}
|
||||
u.state.NavigateToPath([]string{"Root", "Internet"})
|
||||
u.filter()
|
||||
u.state.SelectedEntryID = "entry-1"
|
||||
instantiated, ok := u.selectedEntry()
|
||||
if !ok {
|
||||
t.Fatal("selectedEntry() ok = false, want instantiated entry")
|
||||
@@ -1136,7 +1138,7 @@ func TestUITemplatesCanBeBrowsedCreatedEditedDeletedAndInstantiated(t *testing.T
|
||||
}
|
||||
|
||||
u.showTemplatesSection()
|
||||
u.currentPath = []string{"Templates", "Web"}
|
||||
u.state.NavigateToPath([]string{"Templates", "Web"})
|
||||
u.filter()
|
||||
u.state.SelectedEntryID = "tpl-web"
|
||||
if err := u.deleteSelectedTemplateAction(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user