Add About section
This commit is contained in:
@@ -5485,6 +5485,36 @@ func TestUISearchPlaceholderIsContextual(t *testing.T) {
|
||||
if got := u.searchPlaceholder(); got != "Search audit log" {
|
||||
t.Fatalf("api audit searchPlaceholder() = %q, want %q", got, "Search audit log")
|
||||
}
|
||||
u.showAboutSection()
|
||||
if got := u.searchPlaceholder(); got != "Search disabled on About" {
|
||||
t.Fatalf("about searchPlaceholder() = %q, want %q", got, "Search disabled on About")
|
||||
}
|
||||
}
|
||||
|
||||
func TestShowAboutSection(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
u := newUIWithModel("desktop", vault.Model{
|
||||
Entries: []vault.Entry{{ID: "entry-1", Title: "Bellagio", Path: []string{"Crew"}}},
|
||||
})
|
||||
u.mainMenuOpen = true
|
||||
u.state.CurrentPath = []string{"Crew"}
|
||||
u.state.SelectedEntryID = "entry-1"
|
||||
|
||||
u.showAboutSection()
|
||||
|
||||
if got := u.state.Section; got != appstate.SectionAbout {
|
||||
t.Fatalf("state.Section = %q, want %q", got, appstate.SectionAbout)
|
||||
}
|
||||
if u.mainMenuOpen {
|
||||
t.Fatal("mainMenuOpen = true, want false")
|
||||
}
|
||||
if len(u.state.CurrentPath) != 0 {
|
||||
t.Fatalf("state.CurrentPath = %v, want empty", u.state.CurrentPath)
|
||||
}
|
||||
if got := u.state.SelectedEntryID; got != "" {
|
||||
t.Fatalf("state.SelectedEntryID = %q, want empty", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIAPIPolicyTargetActionsUseCurrentContext(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user