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

Function TestProjectItems_NoLimit

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

Source from the content-addressed store, hash-verified

169}
170
171func TestProjectItems_NoLimit(t *testing.T) {
172 defer gock.Off()
173 gock.Observe(gock.DumpRequest)
174
175 // list project items
176 gock.New("https://api.github.com").
177 Post("/graphql").
178 JSON(map[string]interface{}{
179 "query": "query UserProjectWithItems.*",
180 "variables": map[string]interface{}{
181 "firstItems": LimitDefault,
182 "afterItems": nil,
183 "firstFields": LimitMax,
184 "afterFields": nil,
185 "login": "monalisa",
186 "number": 1,
187 },
188 }).
189 Reply(200).
190 JSON(map[string]interface{}{
191 "data": map[string]interface{}{
192 "user": map[string]interface{}{
193 "projectV2": map[string]interface{}{
194 "items": map[string]interface{}{
195 "nodes": []map[string]interface{}{
196 {
197 "id": "issue ID",
198 },
199 {
200 "id": "pull request ID",
201 },
202 {
203 "id": "draft issue ID",
204 },
205 },
206 },
207 },
208 },
209 },
210 })
211
212 client := NewTestClient()
213
214 owner := &Owner{
215 Type: "USER",
216 Login: "monalisa",
217 ID: "user ID",
218 }
219 project, err := client.ProjectItems(owner, 1, 0, "")
220 assert.NoError(t, err)
221 assert.Len(t, project.Items.Nodes, 3)
222}
223
224func TestProjectItems_WithQuery(t *testing.T) {
225 tests := []struct {

Callers

nothing calls this directly

Calls 4

ReplyMethod · 0.80
ProjectItemsMethod · 0.80
NewTestClientFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected