(t *testing.T)
| 261 | } |
| 262 | |
| 263 | func TestScopeLabels(t *testing.T) { |
| 264 | tests := []struct { |
| 265 | name string |
| 266 | repoName string |
| 267 | wantFirst []string |
| 268 | wantSecond []string |
| 269 | }{ |
| 270 | { |
| 271 | name: "without repo name", |
| 272 | repoName: "", |
| 273 | wantFirst: []string{"Project", "recommended"}, |
| 274 | wantSecond: []string{"Global"}, |
| 275 | }, |
| 276 | { |
| 277 | name: "with repo name", |
| 278 | repoName: "monalisa/octocat-skills", |
| 279 | wantFirst: []string{"monalisa/octocat-skills", "recommended"}, |
| 280 | wantSecond: []string{"Global"}, |
| 281 | }, |
| 282 | } |
| 283 | for _, tt := range tests { |
| 284 | t.Run(tt.name, func(t *testing.T) { |
| 285 | labels := ScopeLabels(tt.repoName) |
| 286 | require.Len(t, labels, 2) |
| 287 | for _, s := range tt.wantFirst { |
| 288 | assert.Contains(t, labels[0], s) |
| 289 | } |
| 290 | for _, s := range tt.wantSecond { |
| 291 | assert.Contains(t, labels[1], s) |
| 292 | } |
| 293 | }) |
| 294 | } |
| 295 | } |
nothing calls this directly
no test coverage detected