(t *testing.T)
| 120 | } |
| 121 | |
| 122 | func TestFeedCommand_PlainText(t *testing.T) { |
| 123 | resetFeedFlags() |
| 124 | noColor = true |
| 125 | defer func() { noColor = false }() |
| 126 | |
| 127 | oldGitLog := gitLogFunc |
| 128 | gitLogFunc = func(_ string, _ []string) (string, error) { |
| 129 | return sampleGitLogOutput, nil |
| 130 | } |
| 131 | defer func() { gitLogFunc = oldGitLog }() |
| 132 | |
| 133 | oldGitShow := gitShowFunc |
| 134 | gitShowFunc = noopGitShow |
| 135 | defer func() { gitShowFunc = oldGitShow }() |
| 136 | |
| 137 | output, err := captureFeedOutput(t, func() error { |
| 138 | return runFeed(feedCmd, nil) |
| 139 | }) |
| 140 | if err != nil { |
| 141 | t.Fatalf("unexpected error: %v", err) |
| 142 | } |
| 143 | |
| 144 | if !strings.Contains(output, "Recent task activity") { |
| 145 | t.Error("expected header line in output") |
| 146 | } |
| 147 | if !strings.Contains(output, "2026-02-28 10:30") { |
| 148 | t.Error("expected date in output") |
| 149 | } |
| 150 | if !strings.Contains(output, "Alice") { |
| 151 | t.Error("expected author in output") |
| 152 | } |
| 153 | if !strings.Contains(output, "[Modified]") { |
| 154 | t.Error("expected [Modified] status tag") |
| 155 | } |
| 156 | if !strings.Contains(output, "[Added] tasks/") { |
| 157 | t.Error("expected [Added] file entry") |
| 158 | } |
| 159 | if !strings.Contains(output, "042") { |
| 160 | t.Error("expected task ID 042 in output") |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | func TestFeedCommand_JSON(t *testing.T) { |
| 165 | resetFeedFlags() |
nothing calls this directly
no test coverage detected