MCPcopy
hub / github.com/cli/cli / Test_editRun

Function Test_editRun

pkg/cmd/pr/edit/edit_test.go:354–1181  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

352}
353
354func 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 },

Callers

nothing calls this directly

Calls 15

RegisterMethod · 0.95
ExcludeMethod · 0.95
VerifyMethod · 0.95
NewMockFinderFunction · 0.92
NewFunction · 0.92
GraphQLFunction · 0.92
GraphQLMutationFunction · 0.92
NewAssignableBotFunction · 0.92
NewAssignableUserFunction · 0.92
StringResponseFunction · 0.92
TestFunction · 0.92
mockPullRequestUpdateFunction · 0.85

Tested by

no test coverage detected