MCPcopy
hub / github.com/cli/cli / TestRunList_User_tty

Function TestRunList_User_tty

pkg/cmd/project/field-list/field_list_test.go:91–184  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestRunList_User_tty(t *testing.T) {
92 defer gock.Off()
93 // gock.Observe(gock.DumpRequest)
94
95 // get user ID
96 gock.New("https://api.github.com").
97 Post("/graphql").
98 MatchType("json").
99 JSON(map[string]interface{}{
100 "query": "query UserOrgOwner.*",
101 "variables": map[string]interface{}{
102 "login": "monalisa",
103 },
104 }).
105 Reply(200).
106 JSON(map[string]interface{}{
107 "data": map[string]interface{}{
108 "user": map[string]interface{}{
109 "id": "an ID",
110 },
111 },
112 "errors": []interface{}{
113 map[string]interface{}{
114 "type": "NOT_FOUND",
115 "path": []string{"organization"},
116 },
117 },
118 })
119
120 // list project fields
121 gock.New("https://api.github.com").
122 Post("/graphql").
123 JSON(map[string]interface{}{
124 "query": "query UserProject.*",
125 "variables": map[string]interface{}{
126 "login": "monalisa",
127 "number": 1,
128 "firstItems": queries.LimitMax,
129 "afterItems": nil,
130 "firstFields": queries.LimitDefault,
131 "afterFields": nil,
132 },
133 }).
134 Reply(200).
135 JSON(map[string]interface{}{
136 "data": map[string]interface{}{
137 "user": map[string]interface{}{
138 "projectV2": map[string]interface{}{
139 "fields": map[string]interface{}{
140 "nodes": []map[string]interface{}{
141 {
142 "__typename": "ProjectV2Field",
143 "name": "FieldTitle",
144 "id": "field ID",
145 },
146 {
147 "__typename": "ProjectV2SingleSelectField",
148 "name": "Status",

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected