(t *testing.T)
| 458 | } |
| 459 | |
| 460 | func TestProjectFields_DefaultLimit(t *testing.T) { |
| 461 | defer gock.Off() |
| 462 | gock.Observe(gock.DumpRequest) |
| 463 | |
| 464 | // list project fields |
| 465 | // list project fields |
| 466 | gock.New("https://api.github.com"). |
| 467 | Post("/graphql"). |
| 468 | JSON(map[string]interface{}{ |
| 469 | "query": "query UserProject.*", |
| 470 | "variables": map[string]interface{}{ |
| 471 | "login": "monalisa", |
| 472 | "number": 1, |
| 473 | "firstItems": LimitMax, |
| 474 | "afterItems": nil, |
| 475 | "firstFields": LimitMax, |
| 476 | "afterFields": nil, |
| 477 | }, |
| 478 | }). |
| 479 | Reply(200). |
| 480 | JSON(map[string]interface{}{ |
| 481 | "data": map[string]interface{}{ |
| 482 | "user": map[string]interface{}{ |
| 483 | "projectV2": map[string]interface{}{ |
| 484 | "fields": map[string]interface{}{ |
| 485 | "nodes": []map[string]interface{}{ |
| 486 | { |
| 487 | "id": "field ID", |
| 488 | }, |
| 489 | { |
| 490 | "id": "status ID", |
| 491 | }, |
| 492 | { |
| 493 | "id": "iteration ID", |
| 494 | }, |
| 495 | }, |
| 496 | }, |
| 497 | }, |
| 498 | }, |
| 499 | }, |
| 500 | }) |
| 501 | |
| 502 | client := NewTestClient() |
| 503 | |
| 504 | owner := &Owner{ |
| 505 | Type: "USER", |
| 506 | Login: "monalisa", |
| 507 | ID: "user ID", |
| 508 | } |
| 509 | project, err := client.ProjectFields(owner, 1, LimitMax) |
| 510 | assert.NoError(t, err) |
| 511 | assert.Len(t, project.Fields.Nodes, 3) |
| 512 | } |
| 513 | |
| 514 | func TestProjectFields_NoLimit(t *testing.T) { |
| 515 | defer gock.Off() |
nothing calls this directly
no test coverage detected