MCPcopy Create free account
hub / github.com/github/gh-aw / TestMCPFailureSummaryDisplayFields

Function TestMCPFailureSummaryDisplayFields

pkg/cli/logs_display_fields_test.go:57–87  ·  view source on GitHub ↗

TestMCPFailureSummaryDisplayFields verifies that Display fields are used by console rendering

(t *testing.T)

Source from the content-addressed store, hash-verified

55
56// TestMCPFailureSummaryDisplayFields verifies that Display fields are used by console rendering
57func 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}

Callers

nothing calls this directly

Calls 2

RenderStructFunction · 0.92
ErrorfMethod · 0.45

Tested by

no test coverage detected