feat : copy buzzy audit logs
This commit is contained in:
+12
-10
@@ -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,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user