MCPcopy Index your code
hub / github.com/cli/cli / TestProjectFields_DefaultLimit

Function TestProjectFields_DefaultLimit

pkg/cmd/project/shared/queries/queries_test.go:460–512  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

458}
459
460func TestProjectFields_DefaultLimit(t *testing.T) {
461 defer gock.Off()
462 gock.Observe(gock.DumpRequest)
463
464 // list project fields
465 // list project fields
466 gock.New("https://api.github.com").
467 Post("/graphql").
468 JSON(map[string]interface{}{
469 "query": "query UserProject.*",
470 "variables": map[string]interface{}{
471 "login": "monalisa",
472 "number": 1,
473 "firstItems": LimitMax,
474 "afterItems": nil,
475 "firstFields": LimitMax,
476 "afterFields": nil,
477 },
478 }).
479 Reply(200).
480 JSON(map[string]interface{}{
481 "data": map[string]interface{}{
482 "user": map[string]interface{}{
483 "projectV2": map[string]interface{}{
484 "fields": map[string]interface{}{
485 "nodes": []map[string]interface{}{
486 {
487 "id": "field ID",
488 },
489 {
490 "id": "status ID",
491 },
492 {
493 "id": "iteration ID",
494 },
495 },
496 },
497 },
498 },
499 },
500 })
501
502 client := NewTestClient()
503
504 owner := &Owner{
505 Type: "USER",
506 Login: "monalisa",
507 ID: "user ID",
508 }
509 project, err := client.ProjectFields(owner, 1, LimitMax)
510 assert.NoError(t, err)
511 assert.Len(t, project.Fields.Nodes, 3)
512}
513
514func TestProjectFields_NoLimit(t *testing.T) {
515 defer gock.Off()

Callers

nothing calls this directly

Calls 4

ReplyMethod · 0.80
ProjectFieldsMethod · 0.80
NewTestClientFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected