(t *testing.T)
| 259 | } |
| 260 | |
| 261 | func TestIssueRepoInfo_issuesDisabled(t *testing.T) { |
| 262 | httpReg := &httpmock.Registry{} |
| 263 | defer httpReg.Verify(t) |
| 264 | |
| 265 | httpReg.Register( |
| 266 | httpmock.GraphQL(`query IssueRepositoryInfo\b`), |
| 267 | httpmock.StringResponse(` |
| 268 | { "data": { "repository": { |
| 269 | "id": "REPOID", |
| 270 | "name": "REPO", |
| 271 | "owner": {"login": "OWNER"}, |
| 272 | "hasIssuesEnabled": false, |
| 273 | "viewerPermission": "READ" |
| 274 | } } }`)) |
| 275 | |
| 276 | client := newTestClient(httpReg) |
| 277 | repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO")) |
| 278 | require.NoError(t, err) |
| 279 | assert.Equal(t, &Repository{ |
| 280 | ID: "REPOID", |
| 281 | Name: "REPO", |
| 282 | Owner: RepositoryOwner{Login: "OWNER"}, |
| 283 | ViewerPermission: "READ", |
| 284 | hostname: "github.com", |
| 285 | }, repo) |
| 286 | assert.False(t, repo.ViewerCanTriage()) |
| 287 | } |
| 288 | |
| 289 | func Test_RepoMetadata(t *testing.T) { |
| 290 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected