(t *testing.T)
| 505 | } |
| 506 | |
| 507 | func 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 | |
| 543 | func TestFeedCommand_CompletedStatus_JSON(t *testing.T) { |
| 544 | resetFeedFlags() |
nothing calls this directly
no test coverage detected