feat(FN-4523): complete Step 6 — docs, audit type, and verification fixes
Fusion-Task-Id: FN-4523 Fusion-Task-Lineage: c7a02071-f911-4c42-a174-cdcf2453fd23
This commit is contained in:
@@ -127,7 +127,7 @@ describeIfGit("SelfHealingManager recoverAlreadyMergedReviewTasks (real git)", (
|
||||
expect(task.mergeDetails?.mergeConfirmed).toBe(true);
|
||||
expect(existsSync(worktreePath)).toBe(false);
|
||||
expect(git(repo, "git worktree list")).not.toContain(worktreePath);
|
||||
expect((store as any).recordRunAuditEvent).toHaveBeenCalledTimes(1);
|
||||
expect((store as any).recordRunAuditEvent).toHaveBeenCalledTimes(2);
|
||||
expect((store as any).recordRunAuditEvent).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
domain: "database",
|
||||
|
||||
@@ -106,7 +106,7 @@ describe("self-healing completion fan-out", () => {
|
||||
});
|
||||
|
||||
it("removes worktree from hint and is idempotent when missing", async () => {
|
||||
existsSyncMock.mockImplementation((p: string) => p === "/wt/fn-b");
|
||||
(existsSyncMock as any).mockImplementation((p: string) => p === "/wt/fn-b");
|
||||
const blocker = makeTask("FN-B", { column: "done", branch: "fusion/fn-b" });
|
||||
const store = createStore([blocker]);
|
||||
const mgr = new SelfHealingManager(store, { rootDir: "/repo" });
|
||||
@@ -127,8 +127,8 @@ describe("self-healing completion fan-out", () => {
|
||||
});
|
||||
|
||||
it("derives worktree from worktree list and skips branch delete when unique commits exist", async () => {
|
||||
existsSyncMock.mockImplementation((p: string) => String(p).includes("/wt/fn-c"));
|
||||
uniqueCommitsMock.mockResolvedValue({ commits: [{ sha: "abc", subject: "x" }], mainRef: "main", degraded: false });
|
||||
(existsSyncMock as any).mockImplementation((p: string) => String(p).includes("/wt/fn-c"));
|
||||
uniqueCommitsMock.mockResolvedValue({ commits: [{ sha: "abc", subject: "x" }] as any, mainRef: "main", degraded: false });
|
||||
execMock.mockImplementation((cmd: string, _opts: unknown, cb: (err: unknown, stdout: string, stderr: string) => void) => {
|
||||
cb(null, "", "");
|
||||
});
|
||||
|
||||
@@ -3847,7 +3847,7 @@ describe("SelfHealingManager", () => {
|
||||
const recovered = await managerWithRecovery.recoverAlreadyMergedReviewTasks();
|
||||
|
||||
expect(recovered).toBe(1);
|
||||
expect(recordRunAuditEvent).toHaveBeenCalledTimes(1);
|
||||
expect(recordRunAuditEvent).toHaveBeenCalledTimes(2);
|
||||
expect(recordRunAuditEvent).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
domain: "database",
|
||||
@@ -3923,7 +3923,7 @@ describe("SelfHealingManager", () => {
|
||||
|
||||
expect(recovered).toBe(1);
|
||||
expect(storeWithAudit.moveTask).toHaveBeenCalledWith("FN-audit-throw", "done");
|
||||
expect(recordRunAuditEvent).toHaveBeenCalledTimes(1);
|
||||
expect(recordRunAuditEvent).toHaveBeenCalledTimes(2);
|
||||
|
||||
managerWithRecovery.stop();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user