summaryrefslogtreecommitdiff
path: root/internal/askcli/dispatch_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-31 10:07:41 +0300
committerPaul Buetow <paul@buetow.org>2026-05-31 10:07:41 +0300
commit0dfcb0f3fe6db144f02506df95e68707d9b5091c (patch)
treeed6c0b976acca95b403a7939dd49c49de160003b /internal/askcli/dispatch_test.go
parent168d3a1009066ba38a37fe8a2f8f40a649344eae (diff)
ask: add completed sub-command to list completed tasks
Diffstat (limited to 'internal/askcli/dispatch_test.go')
-rw-r--r--internal/askcli/dispatch_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/askcli/dispatch_test.go b/internal/askcli/dispatch_test.go
index c7c7086..2b00a0e 100644
--- a/internal/askcli/dispatch_test.go
+++ b/internal/askcli/dispatch_test.go
@@ -203,7 +203,7 @@ func TestDispatcher_LongHelp(t *testing.T) {
var stdout bytes.Buffer
d.Dispatch(context.Background(), []string{"help"}, nil, &stdout, io.Discard)
output := stdout.String()
- for _, sub := range []string{"add", "list", "all", "ready", "info", "annotate", "start", "stop", "done", "priority", "tag", "dep", "urgency", "watch", "projects", "modify", "denotate", "delete", "fish"} {
+ for _, sub := range []string{"add", "list", "all", "ready", "completed", "info", "annotate", "start", "stop", "done", "priority", "tag", "dep", "urgency", "watch", "projects", "modify", "denotate", "delete", "fish"} {
if !strings.Contains(output, "ask "+sub) {
t.Errorf("help missing subcommand: ask %s", sub)
}
@@ -482,6 +482,11 @@ func TestDispatcher_AllSubcommandsReachExecutor(t *testing.T) {
wantCalls: [][]string{{"+READY", "export"}},
},
{
+ name: "completed",
+ args: []string{"completed"},
+ wantCalls: [][]string{{"status:completed", "export"}},
+ },
+ {
name: "urgency",
args: []string{"urgency"},
wantCalls: [][]string{{"export"}},
@@ -574,7 +579,7 @@ func TestDispatcher_AllSubcommandsReachExecutor(t *testing.T) {
d := NewDispatcher(&spyRunner{runFn: func(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) {
calls = append(calls, append([]string(nil), args...))
switch strings.Join(args, " ") {
- case "export", "status:pending export", "+READY export":
+ case "export", "status:pending export", "+READY export", "status:completed export":
_, _ = io.WriteString(stdout, taskJSONFor("test-uuid"))
case "uuid:test-uuid export":
_, _ = io.WriteString(stdout, taskJSONFor("test-uuid"))