(t *testing.T)
| 447 | } |
| 448 | |
| 449 | func Test_editRun(t *testing.T) { |
| 450 | tests := []struct { |
| 451 | name string |
| 452 | input *EditOptions |
| 453 | httpStubs func(*testing.T, *httpmock.Registry) |
| 454 | stdout string |
| 455 | stderr string |
| 456 | wantErr bool |
| 457 | }{ |
| 458 | { |
| 459 | name: "non-interactive", |
| 460 | input: &EditOptions{ |
| 461 | Detector: &fd.EnabledDetectorMock{}, |
| 462 | IssueNumbers: []int{123}, |
| 463 | Interactive: false, |
| 464 | Editable: prShared.Editable{ |
| 465 | Title: prShared.EditableString{ |
| 466 | Value: "new title", |
| 467 | Edited: true, |
| 468 | }, |
| 469 | Body: prShared.EditableString{ |
| 470 | Value: "new body", |
| 471 | Edited: true, |
| 472 | }, |
| 473 | Assignees: prShared.EditableAssignees{ |
| 474 | EditableSlice: prShared.EditableSlice{ |
| 475 | Add: []string{"monalisa", "hubot"}, |
| 476 | Remove: []string{"octocat"}, |
| 477 | Edited: true, |
| 478 | }, |
| 479 | }, |
| 480 | Labels: prShared.EditableSlice{ |
| 481 | Add: []string{"feature", "TODO", "bug"}, |
| 482 | Remove: []string{"docs"}, |
| 483 | Edited: true, |
| 484 | }, |
| 485 | Projects: prShared.EditableProjects{ |
| 486 | EditableSlice: prShared.EditableSlice{ |
| 487 | Add: []string{"Cleanup", "CleanupV2"}, |
| 488 | Remove: []string{"Roadmap", "RoadmapV2"}, |
| 489 | Edited: true, |
| 490 | }, |
| 491 | }, |
| 492 | Milestone: prShared.EditableString{ |
| 493 | Value: "GA", |
| 494 | Edited: true, |
| 495 | }, |
| 496 | Metadata: api.RepoMetadataResult{ |
| 497 | Labels: []api.RepoLabel{ |
| 498 | {Name: "docs", ID: "DOCSID"}, |
| 499 | }, |
| 500 | }, |
| 501 | }, |
| 502 | FetchOptions: prShared.FetchOptions, |
| 503 | }, |
| 504 | httpStubs: func(t *testing.T, reg *httpmock.Registry) { |
| 505 | mockIssueGet(t, reg) |
| 506 | mockIssueProjectItemsGet(t, reg) |
nothing calls this directly
no test coverage detected