| 661 | } |
| 662 | |
| 663 | func TestIssueList_Search_withProjectItems(t *testing.T) { |
| 664 | reg := &httpmock.Registry{} |
| 665 | defer reg.Verify(t) |
| 666 | |
| 667 | reg.Register( |
| 668 | httpmock.GraphQL(`query IssueSearch\b`), |
| 669 | httpmock.GraphQLQuery(`{ |
| 670 | "data": { |
| 671 | "repository": { |
| 672 | "hasIssuesEnabled": true |
| 673 | }, |
| 674 | "search": { |
| 675 | "issueCount": 1, |
| 676 | "nodes": [ |
| 677 | { |
| 678 | "projectItems": { |
| 679 | "nodes": [ |
| 680 | { |
| 681 | "id": "PVTI_lAHOAA3WC84AW6WNzgJ8rl0", |
| 682 | "project": { |
| 683 | "id": "PVT_kwHOAA3WC84AW6WN", |
| 684 | "title": "Test Public Project" |
| 685 | }, |
| 686 | "status": { |
| 687 | "optionId": "47fc9ee4", |
| 688 | "name": "In Progress" |
| 689 | } |
| 690 | } |
| 691 | ], |
| 692 | "totalCount": 1 |
| 693 | } |
| 694 | } |
| 695 | ] |
| 696 | } |
| 697 | } |
| 698 | }`, func(_ string, params map[string]interface{}) { |
| 699 | require.Equal(t, map[string]interface{}{ |
| 700 | "owner": "OWNER", |
| 701 | "repo": "REPO", |
| 702 | "type": "ISSUE_ADVANCED", |
| 703 | "limit": float64(30), |
| 704 | "query": "( just used to force the search API branch ) repo:OWNER/REPO type:issue", |
| 705 | }, params) |
| 706 | })) |
| 707 | |
| 708 | client := &http.Client{Transport: reg} |
| 709 | issuesAndTotalCount, err := issueList( |
| 710 | client, |
| 711 | // TODO advancedIssueSearchCleanup |
| 712 | // No need for feature detection once GHES 3.17 support ends. |
| 713 | fd.AdvancedIssueSearchSupportedAsOptIn(), |
| 714 | ghrepo.New("OWNER", "REPO"), |
| 715 | prShared.FilterOptions{ |
| 716 | Entity: "issue", |
| 717 | Search: "just used to force the search API branch", |
| 718 | }, |
| 719 | 30, |
| 720 | ) |