(t *testing.T)
| 528 | } |
| 529 | |
| 530 | func 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, |
nothing calls this directly
no test coverage detected