(t *testing.T)
| 333 | } |
| 334 | |
| 335 | func TestPRList_withProjectItems(t *testing.T) { |
| 336 | reg := &httpmock.Registry{} |
| 337 | defer reg.Verify(t) |
| 338 | |
| 339 | reg.Register( |
| 340 | httpmock.GraphQL(`query PullRequestList\b`), |
| 341 | httpmock.GraphQLQuery(`{ |
| 342 | "data": { |
| 343 | "repository": { |
| 344 | "pullRequests": { |
| 345 | "totalCount": 1, |
| 346 | "nodes": [ |
| 347 | { |
| 348 | "projectItems": { |
| 349 | "nodes": [ |
| 350 | { |
| 351 | "id": "PVTI_lAHOAA3WC84AW6WNzgJ8rnQ", |
| 352 | "project": { |
| 353 | "id": "PVT_kwHOAA3WC84AW6WN", |
| 354 | "title": "Test Public Project" |
| 355 | }, |
| 356 | "status": { |
| 357 | "optionId": "47fc9ee4", |
| 358 | "name": "In Progress" |
| 359 | } |
| 360 | } |
| 361 | ], |
| 362 | "totalCount": 1 |
| 363 | } |
| 364 | } |
| 365 | ] |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | }`, func(_ string, params map[string]interface{}) { |
| 370 | require.Equal(t, map[string]interface{}{ |
| 371 | "owner": "OWNER", |
| 372 | "repo": "REPO", |
| 373 | "limit": float64(30), |
| 374 | "state": []interface{}{"OPEN"}, |
| 375 | }, params) |
| 376 | })) |
| 377 | |
| 378 | client := &http.Client{Transport: reg} |
| 379 | prsAndTotalCount, err := listPullRequests( |
| 380 | client, |
| 381 | nil, |
| 382 | ghrepo.New("OWNER", "REPO"), |
| 383 | prShared.FilterOptions{ |
| 384 | Entity: "pr", |
| 385 | State: "open", |
| 386 | }, |
| 387 | 30, |
| 388 | ) |
| 389 | |
| 390 | require.NoError(t, err) |
| 391 | require.Len(t, prsAndTotalCount.PullRequests, 1) |
| 392 | require.Len(t, prsAndTotalCount.PullRequests[0].ProjectItems.Nodes, 1) |
nothing calls this directly
no test coverage detected