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

Function TestProjectFields_LowerLimit

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

Source from the content-addressed store, hash-verified

408}
409
410func TestProjectFields_LowerLimit(t *testing.T) {
411
412 defer gock.Off()
413 gock.Observe(gock.DumpRequest)
414
415 // list project fields
416 gock.New("https://api.github.com").
417 Post("/graphql").
418 JSON(map[string]interface{}{
419 "query": "query UserProject.*",
420 "variables": map[string]interface{}{
421 "login": "monalisa",
422 "number": 1,
423 "firstItems": LimitMax,
424 "afterItems": nil,
425 "firstFields": 2,
426 "afterFields": nil,
427 },
428 }).
429 Reply(200).
430 JSON(map[string]interface{}{
431 "data": map[string]interface{}{
432 "user": map[string]interface{}{
433 "projectV2": map[string]interface{}{
434 "fields": map[string]interface{}{
435 "nodes": []map[string]interface{}{
436 {
437 "id": "field ID",
438 },
439 {
440 "id": "status ID",
441 },
442 },
443 },
444 },
445 },
446 },
447 })
448
449 client := NewTestClient()
450 owner := &Owner{
451 Type: "USER",
452 Login: "monalisa",
453 ID: "user ID",
454 }
455 project, err := client.ProjectFields(owner, 1, 2)
456 assert.NoError(t, err)
457 assert.Len(t, project.Fields.Nodes, 2)
458}
459
460func TestProjectFields_DefaultLimit(t *testing.T) {
461 defer gock.Off()

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