test(FN-5003): assert noop audit emission in merge recovery

Fusion-Task-Id: FN-5003
Fusion-Task-Lineage: c5f1f326-934b-4cfc-8ba9-a2ac70a4f4f4
This commit is contained in:
Fusion (runfusion.ai)
2026-05-17 22:35:13 -07:00
committed by gsxdsm
parent 18e827dc81
commit a61dfd3f5d
2 changed files with 36 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ type MockTaskStore = {
logEntry: ReturnType<typeof vi.fn>;
getActiveMergingTask: ReturnType<typeof vi.fn>;
createTask: ReturnType<typeof vi.fn>;
recordRunAuditEvent: ReturnType<typeof vi.fn>;
on: ReturnType<typeof vi.fn>;
off: ReturnType<typeof vi.fn>;
};
@@ -129,6 +130,7 @@ function makeStore({
id: "FN-9999",
description: input.description,
})),
recordRunAuditEvent: vi.fn(async () => undefined),
on: vi.fn(),
off: vi.fn(),
};
@@ -765,6 +767,17 @@ describe("ProjectEngine merge error recovery", () => {
expect.stringContaining("[verification] post-finalize verification failed for already-on-main fast-path; no action"),
"VerificationError",
);
expect(store.recordRunAuditEvent).toHaveBeenCalledWith(expect.objectContaining({
domain: "database",
mutationType: "task:post-finalize-verification-no-op",
target: TASK_ID,
metadata: expect.objectContaining({
taskId: TASK_ID,
commitSha: "abcdef1234567890",
failedCommand: null,
exitCode: null,
}),
}));
});
it("moves task back to in-progress with merge-remediation status on verification errors", async () => {