MCPcopy Create free account
hub / github.com/driangle/taskmd / TestFeedCommand_CancelledStatus

Function TestFeedCommand_CancelledStatus

apps/cli/internal/cli/feed_test.go:507–541  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

505}
506
507func TestFeedCommand_CancelledStatus(t *testing.T) {
508 resetFeedFlags()
509 noColor = true
510 defer func() { noColor = false }()
511
512 oldGitLog := gitLogFunc
513 gitLogFunc = func(_ string, _ []string) (string, error) {
514 return sampleGitLogOutput, nil
515 }
516 defer func() { gitLogFunc = oldGitLog }()
517
518 oldGitShow := gitShowFunc
519 gitShowFunc = func(hash, path string) (string, error) {
520 if strings.Contains(path, "042") {
521 if strings.HasSuffix(hash, "^") {
522 return "---\nid: 042\ntitle: Add Auth\nstatus: in-progress\n---\n# Task", nil
523 }
524 return "---\nid: 042\ntitle: Add Auth\nstatus: cancelled\n---\n# Task", nil
525 }
526 return "", fmt.Errorf("not found")
527 }
528 defer func() { gitShowFunc = oldGitShow }()
529
530 output, err := captureFeedOutput(t, func() error {
531 return runFeed(feedCmd, nil)
532 })
533 if err != nil {
534 t.Fatalf("unexpected error: %v", err)
535 }
536
537 // Rich diff shows status transition as compact summary
538 if !strings.Contains(output, "status in-progress") || !strings.Contains(output, "cancelled") {
539 t.Error("expected status transition in output")
540 }
541}
542
543func TestFeedCommand_CompletedStatus_JSON(t *testing.T) {
544 resetFeedFlags()

Callers

nothing calls this directly

Calls 4

resetFeedFlagsFunction · 0.85
captureFeedOutputFunction · 0.85
runFeedFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected