MCPcopy
hub / github.com/cli/cli / TestRunList_tty

Function TestRunList_tty

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

Source from the content-addressed store, hash-verified

250}
251
252func TestRunList_tty(t *testing.T) {
253 defer gock.Off()
254 gock.Observe(gock.DumpRequest)
255 // get user ID
256 gock.New("https://api.github.com").
257 Post("/graphql").
258 MatchType("json").
259 JSON(map[string]interface{}{
260 "query": "query UserOrgOwner.*",
261 "variables": map[string]interface{}{
262 "login": "monalisa",
263 },
264 }).
265 Reply(200).
266 JSON(map[string]interface{}{
267 "data": map[string]interface{}{
268 "user": map[string]interface{}{
269 "id": "an ID",
270 },
271 },
272 "errors": []interface{}{
273 map[string]interface{}{
274 "type": "NOT_FOUND",
275 "path": []string{"organization"},
276 },
277 },
278 })
279
280 gock.New("https://api.github.com").
281 Post("/graphql").
282 Reply(200).
283 JSON(map[string]interface{}{
284 "data": map[string]interface{}{
285 "user": map[string]interface{}{
286 "login": "monalisa",
287 "projectsV2": map[string]interface{}{
288 "nodes": []interface{}{
289 map[string]interface{}{
290 "title": "Project 1",
291 "shortDescription": "Short description 1",
292 "url": "url1",
293 "closed": false,
294 "ID": "id-1",
295 "number": 1,
296 },
297 map[string]interface{}{
298 "title": "Project 2",
299 "shortDescription": "",
300 "url": "url2",
301 "closed": true,
302 "ID": "id-2",
303 "number": 2,
304 },
305 },
306 },
307 },
308 },
309 })

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