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