(t *testing.T)
| 488 | } |
| 489 | |
| 490 | func TestRepoList_noVisibilityField(t *testing.T) { |
| 491 | ios, _, stdout, stderr := iostreams.Test() |
| 492 | ios.SetStdoutTTY(false) |
| 493 | ios.SetStdinTTY(false) |
| 494 | ios.SetStderrTTY(false) |
| 495 | |
| 496 | reg := &httpmock.Registry{} |
| 497 | defer reg.Verify(t) |
| 498 | |
| 499 | reg.Register( |
| 500 | httpmock.GraphQL(`query RepositoryList\b`), |
| 501 | httpmock.GraphQLQuery(`{"data":{"repositoryOwner":{"login":"octocat","repositories":{"totalCount":0}}}}`, |
| 502 | func(query string, params map[string]interface{}) { |
| 503 | assert.False(t, strings.Contains(query, "visibility")) |
| 504 | }, |
| 505 | ), |
| 506 | ) |
| 507 | |
| 508 | opts := ListOptions{ |
| 509 | IO: ios, |
| 510 | HttpClient: func() (*http.Client, error) { |
| 511 | return &http.Client{Transport: reg}, nil |
| 512 | }, |
| 513 | Config: func() (gh.Config, error) { |
| 514 | return config.NewBlankConfig(), nil |
| 515 | }, |
| 516 | Now: func() time.Time { |
| 517 | t, _ := time.Parse(time.RFC822, "19 Feb 21 15:00 UTC") |
| 518 | return t |
| 519 | }, |
| 520 | Limit: 30, |
| 521 | Detector: &fd.DisabledDetectorMock{}, |
| 522 | } |
| 523 | |
| 524 | err := listRun(&opts) |
| 525 | |
| 526 | assert.NoError(t, err) |
| 527 | assert.Equal(t, "", stderr.String()) |
| 528 | assert.Equal(t, "", stdout.String()) |
| 529 | } |
| 530 | |
| 531 | func TestRepoList_invalidOwner(t *testing.T) { |
| 532 | ios, _, stdout, stderr := iostreams.Test() |
nothing calls this directly
no test coverage detected