(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestHumanOutputProducesStyledTable(t *testing.T) { |
| 12 | t.Parallel() |
| 13 | |
| 14 | t.Run("Should produce styled table", func(t *testing.T) { |
| 15 | t.Parallel() |
| 16 | |
| 17 | deps := newTestDeps(t, &stubClient{ |
| 18 | listAgentsFn: func(_ context.Context, _ AgentQuery) ([]AgentRecord, error) { |
| 19 | return []AgentRecord{{ |
| 20 | Name: "coder", |
| 21 | Provider: "codex", |
| 22 | Model: "gpt-5.4", |
| 23 | Tools: []string{"shell", "edit"}, |
| 24 | Permissions: "approve-reads", |
| 25 | }}, nil |
| 26 | }, |
| 27 | }) |
| 28 | |
| 29 | stdout, _, err := executeRootCommand(t, deps, "agent", "list", "-o", "human") |
| 30 | if err != nil { |
| 31 | t.Fatalf("executeRootCommand() error = %v", err) |
| 32 | } |
| 33 | if !strings.Contains(stdout, "Agents") || !strings.Contains(stdout, "Provider") || |
| 34 | !strings.Contains(stdout, "----") { |
| 35 | t.Fatalf("human output = %q, want styled table", stdout) |
| 36 | } |
| 37 | }) |
| 38 | } |
| 39 | |
| 40 | func TestJSONOutputProducesValidJSON(t *testing.T) { |
| 41 | t.Parallel() |
nothing calls this directly
no test coverage detected