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