Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,17 @@ describe("triage finalize duplicate lineage", () => {
*/
const store = createMockStore({
getSettings: vi.fn().mockResolvedValue({ requirePlanApproval: false, triageDuplicateResolution: "delete" } as Settings),
getTask: vi.fn().mockImplementation(async (id: string) => (
id === "FN-4894"
? createTask({ id: "FN-4894", title: "Canonical", column: "todo", status: null })
: undefined
)),
/*
FNXC:EngineTests 2026-07-17-18:10:
PR #2275 review: preserve a default current-task mock for non-canonical IDs.
Returning undefined for FN-001 risks NPEs if recovery re-fetches the subject task.
*/
getTask: vi.fn().mockImplementation(async (id: string) => {
if (id === "FN-4894") {
return createTask({ id: "FN-4894", title: "Canonical", column: "todo", status: null });
}
return createTask({ id: "FN-001" });
}),
});
await runRecovery(createTask(), "DUPLICATE: FN-4894\n", store);

Expand All @@ -132,11 +138,12 @@ describe("triage finalize duplicate lineage", () => {

it("flags and parks DUPLICATE markers under default prompt resolution", async () => {
const store = createMockStore({
getTask: vi.fn().mockImplementation(async (id: string) => (
id === "FN-4894"
? createTask({ id: "FN-4894", title: "Canonical", column: "todo", status: null })
: undefined
)),
getTask: vi.fn().mockImplementation(async (id: string) => {
if (id === "FN-4894") {
return createTask({ id: "FN-4894", title: "Canonical", column: "todo", status: null });
}
return createTask({ id: "FN-001" });
}),
});
await runRecovery(createTask(), "DUPLICATE: FN-4894\n", store);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,17 @@ describe("triage split/delete lineage forwarding", () => {
autoMerge: true,
triageDuplicateResolution: "delete",
} as Settings),
getTask: vi.fn().mockImplementation(async (id: string) => (
id === "FN-4894"
? createTask({ id: "FN-4894", title: "Canonical", column: "todo", status: null })
: undefined
)),
/*
FNXC:EngineTests 2026-07-17-18:10:
PR #2275 review: keep the createStore default current-task mock for non-canonical
IDs. Returning undefined risks NPEs if recovery re-fetches FN-001 mid-path.
*/
getTask: vi.fn().mockImplementation(async (id: string) => {
if (id === "FN-4894") {
return createTask({ id: "FN-4894", title: "Canonical", column: "todo", status: null });
}
return createTask({ attachments: [], comments: [] } as any);
}),
deleteTask: vi.fn().mockResolvedValue(undefined),
});

Expand Down
Loading