History

fix(pull-requests): missing features & better behaviour (#9188)

maria committed 2 months ago

Commit 443b4eb1 parent 4ba39a634 files · +2241 −205Browse files

Showing the changes to apps/server/src/pullRequest/gitLabMergeRequestJson.test.ts (1 of 34 files). Show all

Unified · Split

apps/server/src/pullRequest/gitLabMergeRequestJson.test.ts+22−0
@@ -192,6 +192,28 @@ describe("decodeMergeRequestDetailJson", () => { · 191 unmodified lines
192 expect(armed({})).toBeUndefined();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 it("keeps a divergence GitLab did not count apart from a divergence of none", () => {217 it("keeps a divergence GitLab did not count apart from a divergence of none", () => {
196 const behind = (entry: Record<string, unknown>) =>218 const behind = (entry: Record<string, unknown>) =>
197 expectSuccess(decodeMergeRequestDetailJson(detailJson(entry))).divergedCommits;219 expectSuccess(decodeMergeRequestDetailJson(detailJson(entry))).divergedCommits;