(t *testing.T)
| 341 | } |
| 342 | |
| 343 | func TestScopeLabels(t *testing.T) { |
| 344 | tests := []struct { |
| 345 | name string |
| 346 | repoName string |
| 347 | wantFirst []string |
| 348 | wantSecond []string |
| 349 | }{ |
| 350 | { |
| 351 | name: "without repo name", |
| 352 | repoName: "", |
| 353 | wantFirst: []string{"Project", "recommended"}, |
| 354 | wantSecond: []string{"Global"}, |
| 355 | }, |
| 356 | { |
| 357 | name: "with repo name", |
| 358 | repoName: "monalisa/octocat-skills", |
| 359 | wantFirst: []string{"monalisa/octocat-skills", "recommended"}, |
| 360 | wantSecond: []string{"Global"}, |
| 361 | }, |
| 362 | } |
| 363 | for _, tt := range tests { |
| 364 | t.Run(tt.name, func(t *testing.T) { |
| 365 | labels := ScopeLabels(tt.repoName) |
| 366 | require.Len(t, labels, 2) |
| 367 | for _, s := range tt.wantFirst { |
| 368 | assert.Contains(t, labels[0], s) |
| 369 | } |
| 370 | for _, s := range tt.wantSecond { |
| 371 | assert.Contains(t, labels[1], s) |
| 372 | } |
| 373 | }) |
| 374 | } |
| 375 | } |
nothing calls this directly
no test coverage detected