Showing the changes to apps/server/src/pullRequest/gitLabMergeRequestJson.test.ts (1 of 34 files). Show all
Unified · Split
| @@ -192,6 +192,28 @@ describe("decodeMergeRequestDetailJson", () => { · 191 unmodified lines | ||
| 192 | 192 | expect(armed({})).toBeUndefined(); |
| 193 | 193 | }); |
| 194 | 194 | |
| 195 | + it("keeps the squash choice stored with auto-merge", () => { | |
| 196 | + expect( | |
| 197 | + expectSuccess( | |
| 198 | + decodeMergeRequestDetailJson( | |
| 199 | + detailJson({ auto_merge_enabled: true, squash_on_merge: true }), | |
| 200 | + ), | |
| 201 | + ), | |
| 202 | + ).toMatchObject({ autoMergeEnabled: true, autoMergeMethod: "squash" }); | |
| 203 | + | |
| 204 | + expect( | |
| 205 | + expectSuccess( | |
| 206 | + decodeMergeRequestDetailJson( | |
| 207 | + detailJson({ | |
| 208 | + auto_merge_enabled: true, | |
| 209 | + squash: true, | |
| 210 | + squash_on_merge: false, | |
| 211 | + }), | |
| 212 | + ), | |
| 213 | + ).autoMergeMethod, | |
| 214 | + ).toBeUndefined(); | |
| 215 | + }); | |
| 216 | + | |
| 195 | 217 | it("keeps a divergence GitLab did not count apart from a divergence of none", () => { |
| 196 | 218 | const behind = (entry: Record<string, unknown>) => |
| 197 | 219 | expectSuccess(decodeMergeRequestDetailJson(detailJson(entry))).divergedCommits; |