MCPcopy Create free account
hub / github.com/cli/cli / Test_editRun

Function Test_editRun

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

Source from the content-addressed store, hash-verified

513}
514
515func Test_editRun(t *testing.T) {
516 tests := []struct {
517 name string
518 input *EditOptions
519 httpStubs func(*testing.T, *httpmock.Registry)
520 attach []string
521 host string
522 hostTokens map[string]string
523 uploads []attachments.UploadStub
524 // The lookup builds its field list from a set, so the order varies and
525 // a row cannot assert the whole query.
526 wantLookupSelections []string
527 wantNoLookupSelections []string
528 stdout string
529 stderr string
530 wantErr bool
531 wantErrMsg string
532 // Used instead of wantErrMsg when the subject is which errors survive,
533 // leaving their wording to the layer that formats them.
534 wantErrContains []string
535 }{
536 {
537 name: "non-interactive",
538 input: &EditOptions{
539 Detector: &fd.EnabledDetectorMock{},
540 IssueNumbers: []int{123},
541 Interactive: false,
542 Editable: prShared.Editable{
543 Title: prShared.EditableString{
544 Value: "new title",
545 Edited: true,
546 },
547 Body: prShared.EditableString{
548 Value: "new body",
549 Edited: true,
550 },
551 Assignees: prShared.EditableAssignees{
552 EditableSlice: prShared.EditableSlice{
553 Add: []string{"monalisa", "hubot"},
554 Remove: []string{"octocat"},
555 Edited: true,
556 },
557 },
558 Labels: prShared.EditableSlice{
559 Add: []string{"feature", "TODO", "bug"},
560 Remove: []string{"docs"},
561 Edited: true,
562 },
563 Projects: prShared.EditableProjects{
564 EditableSlice: prShared.EditableSlice{
565 Add: []string{"Cleanup", "CleanupV2"},
566 Remove: []string{"Roadmap", "RoadmapV2"},
567 Edited: true,
568 },
569 },
570 Milestone: prShared.EditableString{
571 Value: "GA",
572 Edited: true,

Callers

nothing calls this directly

Calls 15

RegisterMethod · 0.95
ExcludeMethod · 0.95
VerifyMethod · 0.95
recordedMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
GraphQLMutationMatcherFunction · 0.92
GraphQLMutationFunction · 0.92
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
TestFunction · 0.92
StubUploadToHostFunction · 0.92

Tested by

no test coverage detected