From 508fe7abc17aa344fbe794c8fb73f0a121c8e80f Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Sun, 29 Mar 2026 13:38:47 -0700 Subject: [PATCH] Fix rebased main path tests --- main_test.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/main_test.go b/main_test.go index 14bd0fb..5306d51 100644 --- a/main_test.go +++ b/main_test.go @@ -953,13 +953,27 @@ func TestUIEditingEntryPathMovesEntryBetweenGroups(t *testing.T) { } u.state.SelectedEntryID = "vault-console" - u.state.SelectedEntryID = "vault-console" - item, ok := u.selectedEntry() + model, err := u.state.Session.Current() + if err != nil { + t.Fatalf("state.Session.Current() error = %v", err) + } + + var ( + item vault.Entry + ok bool + ) + for _, candidate := range model.Entries { + if candidate.ID == "vault-console" { + item = candidate + ok = true + break + } + } if !ok { - t.Fatal("selectedEntry() ok = false, want moved entry") + t.Fatal("model.Entries contains vault-console = false, want moved entry") } if !slices.Equal(item.Path, []string{"Root", "Infrastructure"}) { - t.Fatalf("selectedEntry().Path = %v, want [Root Infrastructure]", item.Path) + t.Fatalf("model.Entries vault-console Path = %v, want [Root Infrastructure]", item.Path) } }