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

Function Test_editRun

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

Source from the content-addressed store, hash-verified

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