(t *testing.T)
| 2073 | } |
| 2074 | |
| 2075 | func TestPrAddToMergeQueueAdminWithMergeStrategy(t *testing.T) { |
| 2076 | http := initFakeHTTP() |
| 2077 | defer http.Verify(t) |
| 2078 | |
| 2079 | shared.StubFinderForRunCommandStyleTests(t, |
| 2080 | "1", |
| 2081 | &api.PullRequest{ |
| 2082 | ID: "THE-ID", |
| 2083 | Number: 1, |
| 2084 | State: "OPEN", |
| 2085 | Title: "The title of the PR", |
| 2086 | MergeStateStatus: "CLEAN", |
| 2087 | IsInMergeQueue: false, |
| 2088 | }, |
| 2089 | baseRepo("OWNER", "REPO", "main"), |
| 2090 | ) |
| 2091 | |
| 2092 | http.Register( |
| 2093 | httpmock.GraphQL(`mutation PullRequestMerge\b`), |
| 2094 | httpmock.GraphQLMutation(`{}`, func(input map[string]any) { |
| 2095 | assert.Equal(t, "THE-ID", input["pullRequestId"].(string)) |
| 2096 | assert.Equal(t, "MERGE", input["mergeMethod"].(string)) |
| 2097 | assert.NotContains(t, input, "commitHeadline") |
| 2098 | }), |
| 2099 | ) |
| 2100 | |
| 2101 | cs, cmdTeardown := run.Stub() |
| 2102 | defer cmdTeardown(t) |
| 2103 | cs.Register(`git rev-parse --verify refs/heads/`, 0, "") |
| 2104 | |
| 2105 | output, err := runCommand(http, nil, "blueberries", true, "pr merge 1 --admin --merge") |
| 2106 | if err != nil { |
| 2107 | t.Fatalf("error running command `pr merge`: %v", err) |
| 2108 | } |
| 2109 | |
| 2110 | assert.Equal(t, "", output.String()) |
| 2111 | assert.Equal(t, "✓ Merged pull request OWNER/REPO#1 (The title of the PR)\n", output.Stderr()) |
| 2112 | } |
| 2113 | |
| 2114 | func TestPrMerge_deleteBranch_worktrees(t *testing.T) { |
| 2115 | type stub struct { |
nothing calls this directly
no test coverage detected