(t *testing.T)
| 324 | } |
| 325 | |
| 326 | func TestScopeLabels(t *testing.T) { |
| 327 | tests := []struct { |
| 328 | name string |
| 329 | repoName string |
| 330 | wantFirst []string |
| 331 | wantSecond []string |
| 332 | }{ |
| 333 | { |
| 334 | name: "without repo name", |
| 335 | repoName: "", |
| 336 | wantFirst: []string{"Project", "recommended"}, |
| 337 | wantSecond: []string{"Global"}, |
| 338 | }, |
| 339 | { |
| 340 | name: "with repo name", |
| 341 | repoName: "monalisa/octocat-skills", |
| 342 | wantFirst: []string{"monalisa/octocat-skills", "recommended"}, |
| 343 | wantSecond: []string{"Global"}, |
| 344 | }, |
| 345 | } |
| 346 | for _, tt := range tests { |
| 347 | t.Run(tt.name, func(t *testing.T) { |
| 348 | labels := ScopeLabels(tt.repoName) |
| 349 | require.Len(t, labels, 2) |
| 350 | for _, s := range tt.wantFirst { |
| 351 | assert.Contains(t, labels[0], s) |
| 352 | } |
| 353 | for _, s := range tt.wantSecond { |
| 354 | assert.Contains(t, labels[1], s) |
| 355 | } |
| 356 | }) |
| 357 | } |
| 358 | } |
nothing calls this directly
no test coverage detected