MCPcopy
hub / github.com/cli/cli / TestRunListWithClosed

Function TestRunListWithClosed

pkg/cmd/project/list/list_test.go:599–676  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

597}
598
599func TestRunListWithClosed(t *testing.T) {
600 defer gock.Off()
601 gock.Observe(gock.DumpRequest)
602 // get user ID
603 gock.New("https://api.github.com").
604 Post("/graphql").
605 MatchType("json").
606 JSON(map[string]interface{}{
607 "query": "query UserOrgOwner.*",
608 "variables": map[string]interface{}{
609 "login": "monalisa",
610 },
611 }).
612 Reply(200).
613 JSON(map[string]interface{}{
614 "data": map[string]interface{}{
615 "user": map[string]interface{}{
616 "id": "an ID",
617 },
618 },
619 "errors": []interface{}{
620 map[string]interface{}{
621 "type": "NOT_FOUND",
622 "path": []string{"organization"},
623 },
624 },
625 })
626
627 gock.New("https://api.github.com").
628 Post("/graphql").
629 Reply(200).
630 JSON(map[string]interface{}{
631 "data": map[string]interface{}{
632 "user": map[string]interface{}{
633 "login": "monalisa",
634 "projectsV2": map[string]interface{}{
635 "nodes": []interface{}{
636 map[string]interface{}{
637 "title": "Project 1",
638 "shortDescription": "Short description 1",
639 "url": "url1",
640 "closed": false,
641 "ID": "id-1",
642 "number": 1,
643 },
644 map[string]interface{}{
645 "title": "Project 2",
646 "shortDescription": "",
647 "url": "url2",
648 "closed": true,
649 "ID": "id-2",
650 "number": 2,
651 },
652 },
653 },
654 },
655 },
656 })

Callers

nothing calls this directly

Calls 6

NewTestClientFunction · 0.92
TestFunction · 0.92
ReplyMethod · 0.80
EqualMethod · 0.80
runListFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected