feat: ui.recentIcon marks items used lately with ◷, and lazysecrets list --recent
This commit is contained in:
9 files changed
+87
-22
No files matched your search
@@ -6,6 +6,7 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/lipgloss/v2"
|
||||
@@ -434,3 +435,20 @@ func TestStarIsPerAccount(t *testing.T) {
|
||||
t.Errorf("favourites should list alice's star only: %q", labels)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecentIcon(t *testing.T) {
|
||||
t.Parallel()
|
||||
mem, _ := store.Load("")
|
||||
_ = mem.Use("lazysecrets://azure/"+kv+"/secrets/api-key", time.Now(), func(*store.Node) {})
|
||||
d := newDriverOpts(t, Options{Store: mem, RecentIcon: true})
|
||||
d.keys("3")
|
||||
scr := d.screen()
|
||||
if !strings.Contains(scr, "◷ api-key") || strings.Contains(scr, "◷ db-password") {
|
||||
t.Errorf("want ◷ on api-key only:\n%s", scr)
|
||||
}
|
||||
off := newDriverOpts(t, Options{Store: mem})
|
||||
off.keys("3")
|
||||
if strings.Contains(off.screen(), "◷") {
|
||||
t.Errorf("◷ without ui.recentIcon:\n%s", off.screen())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user