feat : copy buzzy audit logs
CI / Verify (push) Successful in 2m2s
CI / Build immutable images and deploy (push) Successful in 2m47s

This commit is contained in:
2026-09-27 17:00:25 +07:00 Unverified
parent 8ddb5896b6
commit 188cec9bda
10 changed files with 152 additions and 353 deletions
+12 -10
View File
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "vitest";
vi.mock("server-only", () => ({}));
import { auditLogs } from "@/db/schema";
import { auditLog } from "@/db/schema";
import {
AUDIT_ACTION_LABELS,
AUDIT_ACTIONS,
@@ -45,16 +45,18 @@ describe("audit log", () => {
},
);
expect(insert).toHaveBeenCalledWith(auditLogs);
expect(insert).toHaveBeenCalledWith(auditLog);
expect(values).toHaveBeenCalledWith({
actorId: "admin-1",
actorLabel: "Editor",
action: "guide.weapon.saved",
targetType: "guide",
targetId: "guide-1",
scope: "weapon",
resultingVersion: 4,
metadata: { guideName: "Amber", overwrite: true },
authorId: "admin-1",
author: "Editor",
text: "บันทึก Weapons",
details: {
target: { type: "guide", id: "guide-1" },
scope: "weapon",
version: 4,
guideName: "Amber",
overwrite: true,
},
});
});
});