feat: lazysecrets open --action goes, copies or shows without asking
This commit is contained in:
4 files changed
+65
-19
No files matched your search
@@ -206,6 +206,19 @@ func TestOpenPromptAndStartupOpen(t *testing.T) {
|
||||
if _, _, s := d2.selected(); s != "api-key" {
|
||||
t.Errorf("open at startup: selected %q", s)
|
||||
}
|
||||
|
||||
// --action: no question, it does that.
|
||||
d3 := newDriverOpts(t, Options{Open: &r, OpenAction: "go"})
|
||||
if d3.m.prompt != nil {
|
||||
t.Fatalf("--action go asked: %q", d3.m.prompt.title)
|
||||
}
|
||||
if _, _, s := d3.selected(); s != "api-key" {
|
||||
t.Errorf("--action go: selected %q", s)
|
||||
}
|
||||
d4 := newDriverOpts(t, Options{Open: &r, OpenAction: "copy"})
|
||||
if _, _, s := d4.selected(); s != "api-key" || d4.clip().content == "" {
|
||||
t.Errorf("--action copy: selected %q, copied %q", s, d4.clip().content)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShareLinks(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user