(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestIssueRepoInfo_success(t *testing.T) { |
| 150 | httpReg := &httpmock.Registry{} |
| 151 | defer httpReg.Verify(t) |
| 152 | |
| 153 | httpReg.Register( |
| 154 | httpmock.GraphQL(`query IssueRepositoryInfo\b`), |
| 155 | httpmock.StringResponse(` |
| 156 | { "data": { "repository": { |
| 157 | "id": "REPOID", |
| 158 | "name": "REPO", |
| 159 | "owner": {"login": "OWNER"}, |
| 160 | "hasIssuesEnabled": true, |
| 161 | "viewerPermission": "WRITE" |
| 162 | } } }`)) |
| 163 | |
| 164 | client := newTestClient(httpReg) |
| 165 | repo, err := IssueRepoInfo(client, ghrepo.New("OWNER", "REPO")) |
| 166 | require.NoError(t, err) |
| 167 | assert.Equal(t, &Repository{ |
| 168 | ID: "REPOID", |
| 169 | Name: "REPO", |
| 170 | Owner: RepositoryOwner{Login: "OWNER"}, |
| 171 | HasIssuesEnabled: true, |
| 172 | ViewerPermission: "WRITE", |
| 173 | hostname: "github.com", |
| 174 | }, repo) |
| 175 | assert.True(t, repo.ViewerCanTriage()) |
| 176 | } |
| 177 | |
| 178 | func TestIssueRepoInfo_issuesDisabled(t *testing.T) { |
| 179 | httpReg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected