MCPcopy Index your code
hub / github.com/cli/cli / TestPrCheckStatusSummaryWithColor

Function TestPrCheckStatusSummaryWithColor

pkg/cmd/pr/shared/display_test.go:100–168  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestPrCheckStatusSummaryWithColor(t *testing.T) {
101 testCases := []struct {
102 Name string
103 args api.PullRequestChecksStatus
104 want string
105 }{
106 {
107 Name: "No Checks",
108 args: api.PullRequestChecksStatus{
109 Total: 0,
110 Failing: 0,
111 Passing: 0,
112 Pending: 0,
113 },
114 want: "No checks",
115 },
116 {
117 Name: "All Passing",
118 args: api.PullRequestChecksStatus{
119 Total: 3,
120 Failing: 0,
121 Passing: 3,
122 Pending: 0,
123 },
124 want: "✓ Checks passing",
125 },
126 {
127 Name: "Some pending",
128 args: api.PullRequestChecksStatus{
129 Total: 3,
130 Failing: 0,
131 Passing: 1,
132 Pending: 2,
133 },
134 want: "- Checks pending",
135 },
136 {
137 Name: "Sll failing",
138 args: api.PullRequestChecksStatus{
139 Total: 3,
140 Failing: 3,
141 Passing: 0,
142 Pending: 0,
143 },
144 want: "× All checks failing",
145 },
146 {
147 Name: "Some failing",
148 args: api.PullRequestChecksStatus{
149 Total: 3,
150 Failing: 2,
151 Passing: 1,
152 Pending: 0,
153 },
154 want: "× 2/3 checks failing",
155 },
156 }
157

Callers

nothing calls this directly

Calls 6

TestFunction · 0.92
SetStdoutTTYMethod · 0.80
ColorSchemeMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected