(t *testing.T)
| 230 | } |
| 231 | |
| 232 | func TestIssueRepoInfo_success(t *testing.T) { |
| 233 | httpReg := &httpmock.Registry{} |
| 234 | defer httpReg.Verify(t) |
| 235 | |
| 236 | httpReg.Register( |
| 237 | httpmock.GraphQL(`query IssueRepositoryInfo\b`), |
| 238 | httpmock.StringResponse(` |
| 239 | { "data": { "repository": { |
| 240 | "id": "REPOID", |
| 241 | "name": "REPO", |
| 242 | "owner": {"login": "OWNER"}, |
| 243 | "hasIssuesEnabled": true, |
| 244 | "viewerPermission": "WRITE" |
| 245 | } } }`)) |
| 246 | |
| 247 | client := newTestClient(httpReg) |
| 248 | repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO")) |
| 249 | require.NoError(t, err) |
| 250 | assert.Equal(t, &Repository{ |
| 251 | ID: "REPOID", |
| 252 | Name: "REPO", |
| 253 | Owner: RepositoryOwner{Login: "OWNER"}, |
| 254 | HasIssuesEnabled: true, |
| 255 | ViewerPermission: "WRITE", |
| 256 | hostname: "github.com", |
| 257 | }, repo) |
| 258 | assert.True(t, repo.ViewerCanTriage()) |
| 259 | } |
| 260 | |
| 261 | func TestIssueRepoInfo_issuesDisabled(t *testing.T) { |
| 262 | httpReg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected