MCPcopy Create free account
hub / github.com/cli/cli / TestRunList_User_tty

Function TestRunList_User_tty

pkg/cmd/project/item-list/item_list_test.go:138–246  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func TestRunList_User_tty(t *testing.T) {
139 defer gock.Off()
140 // gock.Observe(gock.DumpRequest)
141
142 // get user ID
143 gock.New("https://api.github.com").
144 Post("/graphql").
145 MatchType("json").
146 JSON(map[string]any{
147 "query": "query UserOrgOwner.*",
148 "variables": map[string]any{
149 "login": "monalisa",
150 },
151 }).
152 Reply(200).
153 JSON(map[string]any{
154 "data": map[string]any{
155 "user": map[string]any{
156 "id": "an ID",
157 },
158 },
159 "errors": []any{
160 map[string]any{
161 "type": "NOT_FOUND",
162 "path": []string{"organization"},
163 },
164 },
165 })
166
167 // list project items
168 gock.New("https://api.github.com").
169 Post("/graphql").
170 JSON(map[string]any{
171 "query": "query UserProjectWithItems.*",
172 "variables": map[string]any{
173 "firstItems": queries.LimitDefault,
174 "afterItems": nil,
175 "firstFields": queries.LimitMax,
176 "afterFields": nil,
177 "login": "monalisa",
178 "number": 1,
179 },
180 }).
181 Reply(200).
182 JSON(map[string]any{
183 "data": map[string]any{
184 "user": map[string]any{
185 "projectV2": map[string]any{
186 "items": map[string]any{
187 "nodes": []map[string]any{
188 {
189 "id": "issue ID",
190 "content": map[string]any{
191 "__typename": "Issue",
192 "title": "an issue",
193 "number": 1,
194 "repository": map[string]string{
195 "nameWithOwner": "cli/go-gh",

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.65

Tested by

no test coverage detected