(t *testing.T)
| 508 | } |
| 509 | |
| 510 | func TestStatus_NoBodyInOutput(t *testing.T) { |
| 511 | tmpDir := createStatusTestFiles(t) |
| 512 | resetStatusFlags() |
| 513 | taskDir = tmpDir |
| 514 | |
| 515 | // Text format |
| 516 | output := captureStatusOutput(t, "001") |
| 517 | if strings.Contains(output, "Initial project setup") { |
| 518 | t.Error("Text output should not contain task body") |
| 519 | } |
| 520 | |
| 521 | // JSON format |
| 522 | resetStatusFlags() |
| 523 | taskDir = tmpDir |
| 524 | statusFormat = "json" |
| 525 | output = captureStatusOutput(t, "001") |
| 526 | |
| 527 | var raw map[string]any |
| 528 | if err := json.Unmarshal([]byte(output), &raw); err != nil { |
| 529 | t.Fatalf("Failed to parse JSON: %v", err) |
| 530 | } |
| 531 | if _, ok := raw["content"]; ok { |
| 532 | t.Error("JSON should not have 'content' field") |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | // captureStatusNoArgsOutput runs status with no arguments and captures stdout. |
| 537 | func captureStatusNoArgsOutput(t *testing.T) (string, error) { |
nothing calls this directly
no test coverage detected