feat(FN-4971): add PrInfo regression test
Adds a regression test for the PrInfo endpoint to guard against FN-4971, covering the legacy PR info API path in the dashboard package. Fusion-Task-Id: FN-4971
This commit is contained in:
committed by
gsxdsm
parent
d6679618fe
commit
f5cd0dd472
35
packages/dashboard/app/api/__tests__/legacy-prinfo.test.ts
Normal file
35
packages/dashboard/app/api/__tests__/legacy-prinfo.test.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { PrInfo } from "../legacy";
|
||||
|
||||
describe("legacy PrInfo surface", () => {
|
||||
it("supports optional PR automation and draft fields", () => {
|
||||
const info: PrInfo = {
|
||||
url: "https://github.com/org/repo/pull/1",
|
||||
number: 1,
|
||||
status: "open",
|
||||
title: "Add feature",
|
||||
headBranch: "feature-branch",
|
||||
baseBranch: "main",
|
||||
commentCount: 2,
|
||||
isDraft: true,
|
||||
draft: true,
|
||||
autoMergeOnGreen: true,
|
||||
autoMergeStrategy: "squash",
|
||||
lastMergeError: "merge blocked",
|
||||
lastMergeErrorAt: "2026-05-17T12:00:00.000Z",
|
||||
checkRollup: "pending",
|
||||
mergeable: "blocked",
|
||||
lastCommentAt: "2026-05-17T12:01:00.000Z",
|
||||
lastCheckedAt: "2026-05-17T12:02:00.000Z",
|
||||
lastReviewDecision: "REVIEW_REQUIRED",
|
||||
};
|
||||
|
||||
expect(info.draft).toBe(true);
|
||||
expect(info.isDraft).toBe(true);
|
||||
expect(info.autoMergeOnGreen).toBe(true);
|
||||
expect(info.autoMergeStrategy).toBe("squash");
|
||||
expect(info.lastMergeError).toBe("merge blocked");
|
||||
expect(info.lastMergeErrorAt).toBe("2026-05-17T12:00:00.000Z");
|
||||
expect(info.checkRollup).toBe("pending");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user