(t *testing.T)
| 407 | } |
| 408 | |
| 409 | func TestPRList_Search_withProjectItems(t *testing.T) { |
| 410 | reg := &httpmock.Registry{} |
| 411 | defer reg.Verify(t) |
| 412 | |
| 413 | reg.Register( |
| 414 | httpmock.GraphQL(`query PullRequestSearch\b`), |
| 415 | httpmock.GraphQLQuery(`{ |
| 416 | "data": { |
| 417 | "search": { |
| 418 | "issueCount": 1, |
| 419 | "nodes": [ |
| 420 | { |
| 421 | "projectItems": { |
| 422 | "nodes": [ |
| 423 | { |
| 424 | "id": "PVTI_lAHOAA3WC84AW6WNzgJ8rl0", |
| 425 | "project": { |
| 426 | "id": "PVT_kwHOAA3WC84AW6WN", |
| 427 | "title": "Test Public Project" |
| 428 | }, |
| 429 | "status": { |
| 430 | "optionId": "47fc9ee4", |
| 431 | "name": "In Progress" |
| 432 | } |
| 433 | } |
| 434 | ], |
| 435 | "totalCount": 1 |
| 436 | } |
| 437 | } |
| 438 | ] |
| 439 | } |
| 440 | } |
| 441 | }`, func(_ string, params map[string]interface{}) { |
| 442 | require.Equal(t, map[string]interface{}{ |
| 443 | "limit": float64(30), |
| 444 | "q": "( just used to force the search API branch ) repo:OWNER/REPO state:open type:pr", |
| 445 | "type": "ISSUE_ADVANCED", |
| 446 | }, params) |
| 447 | })) |
| 448 | |
| 449 | client := &http.Client{Transport: reg} |
| 450 | prsAndTotalCount, err := listPullRequests( |
| 451 | client, |
| 452 | // TODO advancedIssueSearchCleanup |
| 453 | // No need for feature detection once GHES 3.17 support ends. |
| 454 | fd.AdvancedIssueSearchSupportedAsOptIn(), |
| 455 | ghrepo.New("OWNER", "REPO"), |
| 456 | prShared.FilterOptions{ |
| 457 | Entity: "pr", |
| 458 | State: "open", |
| 459 | Search: "just used to force the search API branch", |
| 460 | }, |
| 461 | 30, |
| 462 | ) |
| 463 | |
| 464 | require.NoError(t, err) |
| 465 | require.Len(t, prsAndTotalCount.PullRequests, 1) |
| 466 | require.Len(t, prsAndTotalCount.PullRequests[0].ProjectItems.Nodes, 1) |
nothing calls this directly
no test coverage detected