(t *testing.T)
| 466 | } |
| 467 | |
| 468 | func TestFeedCommand_CompletedStatus(t *testing.T) { |
| 469 | resetFeedFlags() |
| 470 | noColor = true |
| 471 | defer func() { noColor = false }() |
| 472 | |
| 473 | oldGitLog := gitLogFunc |
| 474 | gitLogFunc = func(_ string, _ []string) (string, error) { |
| 475 | return sampleGitLogOutput, nil |
| 476 | } |
| 477 | defer func() { gitLogFunc = oldGitLog }() |
| 478 | |
| 479 | oldGitShow := gitShowFunc |
| 480 | gitShowFunc = func(hash, path string) (string, error) { |
| 481 | if strings.Contains(path, "042") { |
| 482 | if strings.HasSuffix(hash, "^") { |
| 483 | return "---\nid: 042\ntitle: Add Auth\nstatus: in-progress\n---\n# Task", nil |
| 484 | } |
| 485 | return "---\nid: 042\ntitle: Add Auth\nstatus: completed\n---\n# Task", nil |
| 486 | } |
| 487 | return "", fmt.Errorf("not found") |
| 488 | } |
| 489 | defer func() { gitShowFunc = oldGitShow }() |
| 490 | |
| 491 | output, err := captureFeedOutput(t, func() error { |
| 492 | return runFeed(feedCmd, nil) |
| 493 | }) |
| 494 | if err != nil { |
| 495 | t.Fatalf("unexpected error: %v", err) |
| 496 | } |
| 497 | |
| 498 | // Rich diff shows status transition as compact summary |
| 499 | if !strings.Contains(output, "status in-progress") || !strings.Contains(output, "completed") { |
| 500 | t.Error("expected status transition in output") |
| 501 | } |
| 502 | if !strings.Contains(output, "[Added]") { |
| 503 | t.Error("expected [Added] tag for task 043") |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | func TestFeedCommand_CancelledStatus(t *testing.T) { |
| 508 | resetFeedFlags() |
nothing calls this directly
no test coverage detected