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