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

Function Test_editRun

pkg/cmd/issue/edit/edit_test.go:449–1273  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

447}
448
449func Test_editRun(t *testing.T) {
450 tests := []struct {
451 name string
452 input *EditOptions
453 httpStubs func(*testing.T, *httpmock.Registry)
454 stdout string
455 stderr string
456 wantErr bool
457 }{
458 {
459 name: "non-interactive",
460 input: &EditOptions{
461 Detector: &fd.EnabledDetectorMock{},
462 IssueNumbers: []int{123},
463 Interactive: false,
464 Editable: prShared.Editable{
465 Title: prShared.EditableString{
466 Value: "new title",
467 Edited: true,
468 },
469 Body: prShared.EditableString{
470 Value: "new body",
471 Edited: true,
472 },
473 Assignees: prShared.EditableAssignees{
474 EditableSlice: prShared.EditableSlice{
475 Add: []string{"monalisa", "hubot"},
476 Remove: []string{"octocat"},
477 Edited: true,
478 },
479 },
480 Labels: prShared.EditableSlice{
481 Add: []string{"feature", "TODO", "bug"},
482 Remove: []string{"docs"},
483 Edited: true,
484 },
485 Projects: prShared.EditableProjects{
486 EditableSlice: prShared.EditableSlice{
487 Add: []string{"Cleanup", "CleanupV2"},
488 Remove: []string{"Roadmap", "RoadmapV2"},
489 Edited: true,
490 },
491 },
492 Milestone: prShared.EditableString{
493 Value: "GA",
494 Edited: true,
495 },
496 Metadata: api.RepoMetadataResult{
497 Labels: []api.RepoLabel{
498 {Name: "docs", ID: "DOCSID"},
499 },
500 },
501 },
502 FetchOptions: prShared.FetchOptions,
503 },
504 httpStubs: func(t *testing.T, reg *httpmock.Registry) {
505 mockIssueGet(t, reg)
506 mockIssueProjectItemsGet(t, reg)

Callers

nothing calls this directly

Calls 15

RegisterMethod · 0.95
VerifyMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
GraphQLMutationMatcherFunction · 0.92
GraphQLMutationFunction · 0.92
TestFunction · 0.92
NewFunction · 0.92
mockIssueGetFunction · 0.85
mockIssueProjectItemsGetFunction · 0.85
mockIssueUpdateFunction · 0.85
mockIssueUpdateApiActorsFunction · 0.85

Tested by

no test coverage detected