(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func TestPRReady(t *testing.T) { |
| 124 | http := &httpmock.Registry{} |
| 125 | defer http.Verify(t) |
| 126 | |
| 127 | shared.StubFinderForRunCommandStyleTests(t, "123", &api.PullRequest{ |
| 128 | ID: "THE-ID", |
| 129 | Number: 123, |
| 130 | State: "OPEN", |
| 131 | IsDraft: true, |
| 132 | }, ghrepo.New("OWNER", "REPO")) |
| 133 | |
| 134 | http.Register( |
| 135 | httpmock.GraphQL(`mutation PullRequestReadyForReview\b`), |
| 136 | httpmock.GraphQLMutation(`{"id": "THE-ID"}`, |
| 137 | func(inputs map[string]interface{}) { |
| 138 | assert.Equal(t, inputs["pullRequestId"], "THE-ID") |
| 139 | }), |
| 140 | ) |
| 141 | |
| 142 | output, err := runCommand(http, true, "123") |
| 143 | assert.NoError(t, err) |
| 144 | assert.Equal(t, "", output.String()) |
| 145 | assert.Equal(t, "✓ Pull request OWNER/REPO#123 is marked as \"ready for review\"\n", output.Stderr()) |
| 146 | } |
| 147 | |
| 148 | func TestPRReady_alreadyReady(t *testing.T) { |
| 149 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected