(t *testing.T)
| 105 | } |
| 106 | |
| 107 | func TestPrClose(t *testing.T) { |
| 108 | http := &httpmock.Registry{} |
| 109 | defer http.Verify(t) |
| 110 | |
| 111 | baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature") |
| 112 | pr.Title = "The title of the PR" |
| 113 | shared.StubFinderForRunCommandStyleTests(t, "96", pr, baseRepo) |
| 114 | |
| 115 | http.Register( |
| 116 | httpmock.GraphQL(`mutation PullRequestClose\b`), |
| 117 | httpmock.GraphQLMutation(`{"id": "THE-ID"}`, |
| 118 | func(inputs map[string]interface{}) { |
| 119 | assert.Equal(t, inputs["pullRequestId"], "THE-ID") |
| 120 | }), |
| 121 | ) |
| 122 | |
| 123 | output, err := runCommand(http, true, "96") |
| 124 | assert.NoError(t, err) |
| 125 | assert.Equal(t, "", output.String()) |
| 126 | assert.Equal(t, "✓ Closed pull request OWNER/REPO#96 (The title of the PR)\n", output.Stderr()) |
| 127 | } |
| 128 | |
| 129 | func TestPrClose_alreadyClosed(t *testing.T) { |
| 130 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected