(t *testing.T)
| 98 | } |
| 99 | |
| 100 | func 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 |
nothing calls this directly
no test coverage detected