(t *testing.T)
| 513 | } |
| 514 | |
| 515 | func Test_ProjectNamesToPaths(t *testing.T) { |
| 516 | t.Run("when projectsV1 is supported, requests them", func(t *testing.T) { |
| 517 | http := &httpmock.Registry{} |
| 518 | client := newTestClient(http) |
| 519 | |
| 520 | repo, _ := ghrepo.FromFullName("OWNER/REPO") |
| 521 | |
| 522 | http.Register( |
| 523 | httpmock.GraphQL(`query RepositoryProjectList\b`), |
| 524 | httpmock.StringResponse(` |
| 525 | { "data": { "repository": { "projects": { |
| 526 | "nodes": [ |
| 527 | { "name": "Cleanup", "id": "CLEANUPID", "resourcePath": "/OWNER/REPO/projects/1" }, |
| 528 | { "name": "Roadmap", "id": "ROADMAPID", "resourcePath": "/OWNER/REPO/projects/2" } |
| 529 | ], |
| 530 | "pageInfo": { "hasNextPage": false } |
| 531 | } } } } |
| 532 | `)) |
| 533 | http.Register( |
| 534 | httpmock.GraphQL(`query OrganizationProjectList\b`), |
| 535 | httpmock.StringResponse(` |
| 536 | { "data": { "organization": { "projects": { |
| 537 | "nodes": [ |
| 538 | { "name": "Triage", "id": "TRIAGEID", "resourcePath": "/orgs/ORG/projects/1" } |
| 539 | ], |
| 540 | "pageInfo": { "hasNextPage": false } |
| 541 | } } } } |
| 542 | `)) |
| 543 | http.Register( |
| 544 | httpmock.GraphQL(`query RepositoryProjectV2List\b`), |
| 545 | httpmock.StringResponse(` |
| 546 | { "data": { "repository": { "projectsV2": { |
| 547 | "nodes": [ |
| 548 | { "title": "CleanupV2", "id": "CLEANUPV2ID", "resourcePath": "/OWNER/REPO/projects/3" }, |
| 549 | { "title": "RoadmapV2", "id": "ROADMAPV2ID", "resourcePath": "/OWNER/REPO/projects/4" } |
| 550 | ], |
| 551 | "pageInfo": { "hasNextPage": false } |
| 552 | } } } } |
| 553 | `)) |
| 554 | http.Register( |
| 555 | httpmock.GraphQL(`query OrganizationProjectV2List\b`), |
| 556 | httpmock.StringResponse(` |
| 557 | { "data": { "organization": { "projectsV2": { |
| 558 | "nodes": [ |
| 559 | { "title": "TriageV2", "id": "TRIAGEV2ID", "resourcePath": "/orgs/ORG/projects/2" } |
| 560 | ], |
| 561 | "pageInfo": { "hasNextPage": false } |
| 562 | } } } } |
| 563 | `)) |
| 564 | http.Register( |
| 565 | httpmock.GraphQL(`query UserProjectV2List\b`), |
| 566 | httpmock.StringResponse(` |
| 567 | { "data": { "viewer": { "projectsV2": { |
| 568 | "nodes": [ |
| 569 | { "title": "MonalisaV2", "id": "MONALISAV2ID", "resourcePath": "/users/MONALISA/projects/5" } |
| 570 | ], |
| 571 | "pageInfo": { "hasNextPage": false } |
| 572 | } } } } |
nothing calls this directly
no test coverage detected