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

Function TestProjectFields_NoLimit

pkg/cmd/project/shared/queries/queries_test.go:514–565  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

512}
513
514func TestProjectFields_NoLimit(t *testing.T) {
515 defer gock.Off()
516 gock.Observe(gock.DumpRequest)
517
518 // list project fields
519 gock.New("https://api.github.com").
520 Post("/graphql").
521 JSON(map[string]interface{}{
522 "query": "query UserProject.*",
523 "variables": map[string]interface{}{
524 "login": "monalisa",
525 "number": 1,
526 "firstItems": LimitMax,
527 "afterItems": nil,
528 "firstFields": LimitDefault,
529 "afterFields": nil,
530 },
531 }).
532 Reply(200).
533 JSON(map[string]interface{}{
534 "data": map[string]interface{}{
535 "user": map[string]interface{}{
536 "projectV2": map[string]interface{}{
537 "fields": map[string]interface{}{
538 "nodes": []map[string]interface{}{
539 {
540 "id": "field ID",
541 },
542 {
543 "id": "status ID",
544 },
545 {
546 "id": "iteration ID",
547 },
548 },
549 },
550 },
551 },
552 },
553 })
554
555 client := NewTestClient()
556
557 owner := &Owner{
558 Type: "USER",
559 Login: "monalisa",
560 ID: "user ID",
561 }
562 project, err := client.ProjectFields(owner, 1, 0)
563 assert.NoError(t, err)
564 assert.Len(t, project.Fields.Nodes, 3)
565}
566
567func Test_requiredScopesFromServerMessage(t *testing.T) {
568 tests := []struct {

Callers

nothing calls this directly

Calls 4

ReplyMethod · 0.80
ProjectFieldsMethod · 0.80
NewTestClientFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected