(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestMakeScopes(t *testing.T) { |
| 44 | mockGitlabPlugin(t) |
| 45 | |
| 46 | const connectionId = 1 |
| 47 | const gitlabProjectId = 37 |
| 48 | const expectDomainScopeId = "gitlab:GitlabProject:1:37" |
| 49 | |
| 50 | actualScopes, err := makeScopeV200( |
| 51 | connectionId, |
| 52 | []*srvhelper.ScopeDetail[models.GitlabProject, models.GitlabScopeConfig]{ |
| 53 | { |
| 54 | Scope: models.GitlabProject{ |
| 55 | Scope: common.Scope{ |
| 56 | ConnectionId: connectionId, |
| 57 | }, |
| 58 | GitlabId: gitlabProjectId, |
| 59 | }, |
| 60 | ScopeConfig: &models.GitlabScopeConfig{ |
| 61 | ScopeConfig: common.ScopeConfig{ |
| 62 | Entities: []string{plugin.DOMAIN_TYPE_CODE, plugin.DOMAIN_TYPE_TICKET, plugin.DOMAIN_TYPE_CICD}, |
| 63 | }, |
| 64 | }, |
| 65 | }, |
| 66 | }, |
| 67 | ) |
| 68 | assert.Nil(t, err) |
| 69 | assert.Equal(t, 3, len(actualScopes)) |
| 70 | assert.Equal(t, actualScopes[0].ScopeId(), expectDomainScopeId) |
| 71 | assert.Equal(t, actualScopes[1].ScopeId(), expectDomainScopeId) |
| 72 | assert.Equal(t, actualScopes[2].ScopeId(), expectDomainScopeId) |
| 73 | } |
| 74 | |
| 75 | func TestMakeScopesWithEmptyEntities(t *testing.T) { |
| 76 | mockGitlabPlugin(t) |
nothing calls this directly
no test coverage detected