(t *testing.T)
| 176 | } |
| 177 | |
| 178 | func TestIssueRepoInfo_issuesDisabled(t *testing.T) { |
| 179 | httpReg := &httpmock.Registry{} |
| 180 | defer httpReg.Verify(t) |
| 181 | |
| 182 | httpReg.Register( |
| 183 | httpmock.GraphQL(`query IssueRepositoryInfo\b`), |
| 184 | httpmock.StringResponse(` |
| 185 | { "data": { "repository": { |
| 186 | "id": "REPOID", |
| 187 | "name": "REPO", |
| 188 | "owner": {"login": "OWNER"}, |
| 189 | "hasIssuesEnabled": false, |
| 190 | "viewerPermission": "READ" |
| 191 | } } }`)) |
| 192 | |
| 193 | client := newTestClient(httpReg) |
| 194 | repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO")) |
| 195 | require.NoError(t, err) |
| 196 | assert.Equal(t, &Repository{ |
| 197 | ID: "REPOID", |
| 198 | Name: "REPO", |
| 199 | Owner: RepositoryOwner{Login: "OWNER"}, |
| 200 | ViewerPermission: "READ", |
| 201 | hostname: "github.com", |
| 202 | }, repo) |
| 203 | assert.False(t, repo.ViewerCanTriage()) |
| 204 | } |
| 205 | |
| 206 | func Test_RepoMetadata(t *testing.T) { |
| 207 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected