MCPcopy Index your code
hub / github.com/cli/cli / TestRunList_Org

Function TestRunList_Org

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

Source from the content-addressed store, hash-verified

276}
277
278func TestRunList_Org(t *testing.T) {
279 defer gock.Off()
280 // gock.Observe(gock.DumpRequest)
281
282 // get org ID
283 gock.New("https://api.github.com").
284 Post("/graphql").
285 MatchType("json").
286 JSON(map[string]interface{}{
287 "query": "query UserOrgOwner.*",
288 "variables": map[string]interface{}{
289 "login": "github",
290 },
291 }).
292 Reply(200).
293 JSON(map[string]interface{}{
294 "data": map[string]interface{}{
295 "organization": map[string]interface{}{
296 "id": "an ID",
297 },
298 },
299 "errors": []interface{}{
300 map[string]interface{}{
301 "type": "NOT_FOUND",
302 "path": []string{"user"},
303 },
304 },
305 })
306
307 // list project fields
308 gock.New("https://api.github.com").
309 Post("/graphql").
310 JSON(map[string]interface{}{
311 "query": "query OrgProject.*",
312 "variables": map[string]interface{}{
313 "login": "github",
314 "number": 1,
315 "firstItems": queries.LimitMax,
316 "afterItems": nil,
317 "firstFields": queries.LimitDefault,
318 "afterFields": nil,
319 },
320 }).
321 Reply(200).
322 JSON(map[string]interface{}{
323 "data": map[string]interface{}{
324 "organization": map[string]interface{}{
325 "projectV2": map[string]interface{}{
326 "fields": map[string]interface{}{
327 "nodes": []map[string]interface{}{
328 {
329 "__typename": "ProjectV2Field",
330 "name": "FieldTitle",
331 "id": "field ID",
332 },
333 {
334 "__typename": "ProjectV2SingleSelectField",
335 "name": "Status",

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