(t *testing.T)
| 352 | } |
| 353 | |
| 354 | func Test_editRun(t *testing.T) { |
| 355 | tests := []struct { |
| 356 | name string |
| 357 | input *EditOptions |
| 358 | httpStubs func(*testing.T, *httpmock.Registry) |
| 359 | stdout string |
| 360 | stderr string |
| 361 | }{ |
| 362 | { |
| 363 | name: "non-interactive", |
| 364 | input: &EditOptions{ |
| 365 | Detector: &fd.EnabledDetectorMock{}, |
| 366 | SelectorArg: "123", |
| 367 | Finder: shared.NewMockFinder("123", &api.PullRequest{ |
| 368 | URL: "https://github.com/OWNER/REPO/pull/123", |
| 369 | }, ghrepo.New("OWNER", "REPO")), |
| 370 | Interactive: false, |
| 371 | Editable: shared.Editable{ |
| 372 | Title: shared.EditableString{ |
| 373 | Value: "new title", |
| 374 | Edited: true, |
| 375 | }, |
| 376 | Body: shared.EditableString{ |
| 377 | Value: "new body", |
| 378 | Edited: true, |
| 379 | }, |
| 380 | Base: shared.EditableString{ |
| 381 | Value: "base-branch-name", |
| 382 | Edited: true, |
| 383 | }, |
| 384 | Reviewers: shared.EditableReviewers{EditableSlice: shared.EditableSlice{ |
| 385 | Add: []string{"OWNER/core", "OWNER/external", "monalisa", "hubot"}, |
| 386 | Remove: []string{"dependabot"}, |
| 387 | Edited: true, |
| 388 | }}, |
| 389 | Assignees: shared.EditableAssignees{ |
| 390 | EditableSlice: shared.EditableSlice{ |
| 391 | Add: []string{"monalisa", "hubot"}, |
| 392 | Remove: []string{"octocat"}, |
| 393 | Edited: true, |
| 394 | }, |
| 395 | }, |
| 396 | Labels: shared.EditableSlice{ |
| 397 | Add: []string{"feature", "TODO", "bug"}, |
| 398 | Remove: []string{"docs"}, |
| 399 | Edited: true, |
| 400 | }, |
| 401 | Projects: shared.EditableProjects{ |
| 402 | EditableSlice: shared.EditableSlice{ |
| 403 | Add: []string{"Cleanup", "CleanupV2"}, |
| 404 | Remove: []string{"Roadmap", "RoadmapV2"}, |
| 405 | Edited: true, |
| 406 | }, |
| 407 | }, |
| 408 | Milestone: shared.EditableString{ |
| 409 | Value: "GA", |
| 410 | Edited: true, |
| 411 | }, |
nothing calls this directly
no test coverage detected