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

Function TestRunCreateField_DATE

pkg/cmd/project/field-create/field_create_test.go:469–549  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

467}
468
469func TestRunCreateField_DATE(t *testing.T) {
470 defer gock.Off()
471 gock.Observe(gock.DumpRequest)
472 // get viewer ID
473 gock.New("https://api.github.com").
474 Post("/graphql").
475 MatchType("json").
476 JSON(map[string]interface{}{
477 "query": "query ViewerOwner.*",
478 }).
479 Reply(200).
480 JSON(map[string]interface{}{
481 "data": map[string]interface{}{
482 "viewer": map[string]interface{}{
483 "id": "an ID",
484 },
485 },
486 })
487
488 // get project ID
489 gock.New("https://api.github.com").
490 Post("/graphql").
491 MatchType("json").
492 JSON(map[string]interface{}{
493 "query": "query ViewerProject.*",
494 "variables": map[string]interface{}{
495 "number": 1,
496 "firstItems": 0,
497 "afterItems": nil,
498 "firstFields": 0,
499 "afterFields": nil,
500 },
501 }).
502 Reply(200).
503 JSON(map[string]interface{}{
504 "data": map[string]interface{}{
505 "viewer": map[string]interface{}{
506 "projectV2": map[string]interface{}{
507 "id": "an ID",
508 },
509 },
510 },
511 })
512
513 // create Field
514 gock.New("https://api.github.com").
515 Post("/graphql").
516 BodyString(`{"query":"mutation CreateField.*","variables":{"input":{"projectId":"an ID","dataType":"DATE","name":"a name"}}}`).
517 Reply(200).
518 JSON(map[string]interface{}{
519 "data": map[string]interface{}{
520 "createProjectV2Field": map[string]interface{}{
521 "projectV2Field": map[string]interface{}{
522 "id": "Field ID",
523 },
524 },
525 },
526 })

Callers

nothing calls this directly

Calls 7

NewTestClientFunction · 0.92
TestFunction · 0.92
runCreateFieldFunction · 0.85
ReplyMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected