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

Function Test_editRun

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

Source from the content-addressed store, hash-verified

551}
552
553func Test_editRun(t *testing.T) {
554 tests := []struct {
555 name string
556 input *EditOptions
557 httpStubs func(*testing.T, *httpmock.Registry)
558 attach []string
559 host string
560 hostTokens map[string]string
561 uploads []attachments.UploadStub
562 // The lookup builds its field list from a set, so the order varies and
563 // a row cannot assert the whole query.
564 wantLookupSelections []string
565 wantNoLookupSelections []string
566 stdout string
567 stderr string
568 wantErr bool
569 wantErrMsg string
570 // Used instead of wantErrMsg when the subject is which errors survive,
571 // leaving their wording to the layer that formats them.
572 wantErrContains []string
573 wantOperations *attachments.UploadResult
574 }{
575 {
576 name: "non-interactive",
577 input: &EditOptions{
578 Detector: &fd.EnabledDetectorMock{},
579 IssueNumbers: []int{123},
580 Interactive: false,
581 Title: prShared.EditableString{
582 Value: "new title",
583 Edited: true,
584 },
585 Body: prShared.EditableString{
586 Value: "new body",
587 Edited: true,
588 },
589 Assignees: prShared.EditableAssignees{
590 EditableSlice: prShared.EditableSlice{
591 Add: []string{"monalisa", "hubot"},
592 Remove: []string{"octocat"},
593 Edited: true,
594 },
595 },
596 Labels: prShared.EditableSlice{
597 Add: []string{"feature", "TODO", "bug"},
598 Remove: []string{"docs"},
599 Edited: true,
600 },
601 Projects: prShared.EditableProjects{
602 EditableSlice: prShared.EditableSlice{
603 Add: []string{"Cleanup", "CleanupV2"},
604 Remove: []string{"Roadmap", "RoadmapV2"},
605 Edited: true,
606 },
607 },
608 Milestone: prShared.EditableString{
609 Value: "GA",
610 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