MCPcopy
hub / github.com/cli/cli / TestProjectItems_FieldTitle

Function TestProjectItems_FieldTitle

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

Source from the content-addressed store, hash-verified

609}
610
611func TestProjectItems_FieldTitle(t *testing.T) {
612 defer gock.Off()
613 gock.Observe(gock.DumpRequest)
614
615 // list project items
616 gock.New("https://api.github.com").
617 Post("/graphql").
618 JSON(map[string]interface{}{
619 "query": "query UserProjectWithItems.*",
620 "variables": map[string]interface{}{
621 "firstItems": LimitMax,
622 "afterItems": nil,
623 "firstFields": LimitMax,
624 "afterFields": nil,
625 "login": "monalisa",
626 "number": 1,
627 },
628 }).
629 Reply(200).
630 JSON(map[string]interface{}{
631 "data": map[string]interface{}{
632 "user": map[string]interface{}{
633 "projectV2": map[string]interface{}{
634 "items": map[string]interface{}{
635 "nodes": []map[string]interface{}{
636 {
637 "id": "draft issue ID",
638 "fieldValues": map[string]interface{}{
639 "nodes": []map[string]interface{}{
640 {
641 "__typename": "ProjectV2ItemFieldIterationValue",
642 "title": "Iteration Title 1",
643 "iterationId": "iterationId1",
644 },
645 {
646 "__typename": "ProjectV2ItemFieldMilestoneValue",
647 "milestone": map[string]interface{}{
648 "title": "Milestone Title 1",
649 },
650 },
651 },
652 },
653 },
654 },
655 },
656 },
657 },
658 },
659 })
660
661 client := NewTestClient()
662
663 owner := &Owner{
664 Type: "USER",
665 Login: "monalisa",
666 ID: "user ID",
667 }
668 project, err := client.ProjectItems(owner, 1, LimitMax, "")

Callers

nothing calls this directly

Calls 5

ReplyMethod · 0.80
ProjectItemsMethod · 0.80
EqualMethod · 0.80
NewTestClientFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected