(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestProjectItems_LowerLimit(t *testing.T) { |
| 122 | defer gock.Off() |
| 123 | gock.Observe(gock.DumpRequest) |
| 124 | |
| 125 | // list project items |
| 126 | gock.New("https://api.github.com"). |
| 127 | Post("/graphql"). |
| 128 | JSON(map[string]interface{}{ |
| 129 | "query": "query UserProjectWithItems.*", |
| 130 | "variables": map[string]interface{}{ |
| 131 | "firstItems": 2, |
| 132 | "afterItems": nil, |
| 133 | "firstFields": LimitMax, |
| 134 | "afterFields": nil, |
| 135 | "login": "monalisa", |
| 136 | "number": 1, |
| 137 | }, |
| 138 | }). |
| 139 | Reply(200). |
| 140 | JSON(map[string]interface{}{ |
| 141 | "data": map[string]interface{}{ |
| 142 | "user": map[string]interface{}{ |
| 143 | "projectV2": map[string]interface{}{ |
| 144 | "items": map[string]interface{}{ |
| 145 | "nodes": []map[string]interface{}{ |
| 146 | { |
| 147 | "id": "issue ID", |
| 148 | }, |
| 149 | { |
| 150 | "id": "pull request ID", |
| 151 | }, |
| 152 | }, |
| 153 | }, |
| 154 | }, |
| 155 | }, |
| 156 | }, |
| 157 | }) |
| 158 | |
| 159 | client := NewTestClient() |
| 160 | |
| 161 | owner := &Owner{ |
| 162 | Type: "USER", |
| 163 | Login: "monalisa", |
| 164 | ID: "user ID", |
| 165 | } |
| 166 | project, err := client.ProjectItems(owner, 1, 2, "") |
| 167 | assert.NoError(t, err) |
| 168 | assert.Len(t, project.Items.Nodes, 2) |
| 169 | } |
| 170 | |
| 171 | func TestProjectItems_NoLimit(t *testing.T) { |
| 172 | defer gock.Off() |
nothing calls this directly
no test coverage detected