TestMCPFailureSummaryDisplayFields verifies that Display fields are used by console rendering
(t *testing.T)
| 55 | |
| 56 | // TestMCPFailureSummaryDisplayFields verifies that Display fields are used by console rendering |
| 57 | func TestMCPFailureSummaryDisplayFields(t *testing.T) { |
| 58 | // Create a MCPFailureSummary with populated Display field |
| 59 | summaries := []MCPFailureSummary{ |
| 60 | { |
| 61 | ServerName: "github-mcp-server", |
| 62 | Count: 3, |
| 63 | Workflows: []string{"workflow-a", "workflow-b"}, |
| 64 | WorkflowsDisplay: "workflow-a, workflow-b", // This should be rendered |
| 65 | RunIDs: []int64{1, 2, 3}, |
| 66 | }, |
| 67 | } |
| 68 | |
| 69 | // Render using console.RenderStruct |
| 70 | output := console.RenderStruct(summaries) |
| 71 | |
| 72 | // Verify that Display field is included in output |
| 73 | if !strings.Contains(output, "workflow-a, workflow-b") { |
| 74 | t.Errorf("WorkflowsDisplay field not found in console output:\n%s", output) |
| 75 | } |
| 76 | |
| 77 | // Verify headers are present |
| 78 | if !strings.Contains(output, "Server") { |
| 79 | t.Errorf("Server header not found in console output") |
| 80 | } |
| 81 | if !strings.Contains(output, "Failures") { |
| 82 | t.Errorf("Failures header not found in console output") |
| 83 | } |
| 84 | if !strings.Contains(output, "Workflows") { |
| 85 | t.Errorf("Workflows header not found in console output") |
| 86 | } |
| 87 | } |
nothing calls this directly
no test coverage detected