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