feat(FN-3220): add regression tests for branch routing and merge-target beh
Adds regression tests for branch-mode behavior across CLI, core, and dashboard: CLI PR base branch inheritance (task-lifecycle), mission triage branch routing and merge-target trimming (task-merge), and subtask branch-mode UI coverage (SubtaskBreakdownModal, mission-e2e). Fusion-Task-Id: FN-3220
This commit is contained in:
@@ -22,6 +22,13 @@ interface MockTask {
|
||||
title: string;
|
||||
description: string;
|
||||
worktree?: string;
|
||||
baseBranch?: string;
|
||||
branchContext?: {
|
||||
groupId: string;
|
||||
source: "planning" | "mission";
|
||||
assignmentMode: "shared" | "per-task-derived";
|
||||
inheritedBaseBranch?: string;
|
||||
};
|
||||
prInfo?: {
|
||||
number: number;
|
||||
url: string;
|
||||
@@ -140,6 +147,55 @@ describe("processPullRequestMergeTask", () => {
|
||||
expect(pushIdx).toBeLessThan(createIdx);
|
||||
});
|
||||
|
||||
it("uses inherited branch-context merge target when creating a PR", async () => {
|
||||
const task: MockTask = {
|
||||
id: "FN-9002",
|
||||
title: "test",
|
||||
description: "desc",
|
||||
column: "in-review",
|
||||
branchContext: {
|
||||
groupId: "planning:abc",
|
||||
source: "planning",
|
||||
assignmentMode: "shared",
|
||||
inheritedBaseBranch: "develop",
|
||||
},
|
||||
};
|
||||
const branch = getTaskBranchName(task.id);
|
||||
const store = makeStore(task, { baseBranch: "main" });
|
||||
execMock.mockImplementation(() => "");
|
||||
|
||||
const github = {
|
||||
findPrForBranch: vi.fn(async () => null),
|
||||
createPr: vi.fn(async () => ({
|
||||
number: 7,
|
||||
url: "https://github.com/x/y/pull/7",
|
||||
status: "open" as const,
|
||||
headBranch: branch,
|
||||
baseBranch: "develop",
|
||||
})),
|
||||
getPrMergeStatus: vi.fn(async () => ({
|
||||
prInfo: { number: 7, status: "open" as const, url: "https://github.com/x/y/pull/7" },
|
||||
reviewDecision: null,
|
||||
checks: [],
|
||||
mergeReady: false,
|
||||
blockingReasons: [],
|
||||
})),
|
||||
mergePr: vi.fn(),
|
||||
};
|
||||
|
||||
await processPullRequestMergeTask(
|
||||
store as never,
|
||||
"/repo",
|
||||
task.id,
|
||||
github as never,
|
||||
() => undefined,
|
||||
);
|
||||
|
||||
expect(github.createPr).toHaveBeenCalledWith(expect.objectContaining({
|
||||
base: "develop",
|
||||
}));
|
||||
});
|
||||
|
||||
it("skips the push when an existing PR already covers the branch", async () => {
|
||||
const task: MockTask = {
|
||||
id: "FN-9002",
|
||||
|
||||
Reference in New Issue
Block a user