(t *testing.T)
| 512 | } |
| 513 | |
| 514 | func 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 | |
| 567 | func Test_requiredScopesFromServerMessage(t *testing.T) { |
| 568 | tests := []struct { |
nothing calls this directly
no test coverage detected