(t *testing.T)
| 287 | } |
| 288 | |
| 289 | func Test_RepoMetadata(t *testing.T) { |
| 290 | http := &httpmock.Registry{} |
| 291 | client := newTestClient(http) |
| 292 | |
| 293 | repo, _ := ghrepo.FromFullName("OWNER/REPO") |
| 294 | input := RepoMetadataInput{ |
| 295 | Assignees: true, |
| 296 | Reviewers: true, |
| 297 | TeamReviewers: true, |
| 298 | Labels: true, |
| 299 | ProjectsV1: true, |
| 300 | ProjectsV2: true, |
| 301 | Milestones: true, |
| 302 | } |
| 303 | |
| 304 | http.Register( |
| 305 | httpmock.GraphQL(`query RepositoryAssignableUsers\b`), |
| 306 | httpmock.StringResponse(` |
| 307 | { "data": { "repository": { "assignableUsers": { |
| 308 | "nodes": [ |
| 309 | { "login": "hubot", "id": "HUBOTID" }, |
| 310 | { "login": "MonaLisa", "id": "MONAID" } |
| 311 | ], |
| 312 | "pageInfo": { "hasNextPage": false } |
| 313 | } } } } |
| 314 | `)) |
| 315 | http.Register( |
| 316 | httpmock.GraphQL(`query RepositoryLabelList\b`), |
| 317 | httpmock.StringResponse(` |
| 318 | { "data": { "repository": { "labels": { |
| 319 | "nodes": [ |
| 320 | { "name": "feature", "id": "FEATUREID" }, |
| 321 | { "name": "TODO", "id": "TODOID" }, |
| 322 | { "name": "bug", "id": "BUGID" } |
| 323 | ], |
| 324 | "pageInfo": { "hasNextPage": false } |
| 325 | } } } } |
| 326 | `)) |
| 327 | http.Register( |
| 328 | httpmock.GraphQL(`query RepositoryMilestoneList\b`), |
| 329 | httpmock.StringResponse(` |
| 330 | { "data": { "repository": { "milestones": { |
| 331 | "nodes": [ |
| 332 | { "title": "GA", "id": "GAID" }, |
| 333 | { "title": "Big One.oh", "id": "BIGONEID" } |
| 334 | ], |
| 335 | "pageInfo": { "hasNextPage": false } |
| 336 | } } } } |
| 337 | `)) |
| 338 | http.Register( |
| 339 | httpmock.GraphQL(`query RepositoryProjectList\b`), |
| 340 | httpmock.StringResponse(` |
| 341 | { "data": { "repository": { "projects": { |
| 342 | "nodes": [ |
| 343 | { "name": "Cleanup", "id": "CLEANUPID" }, |
| 344 | { "name": "Roadmap", "id": "ROADMAPID" } |
| 345 | ], |
| 346 | "pageInfo": { "hasNextPage": false } |
nothing calls this directly
no test coverage detected