lint: fix biome issues in new test files and helpers
This commit is contained in:
1 parent
99eb3af17b
commit
93862c2275
41 files changed
+488
-314
No files matched your search
@@ -1,7 +1,11 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const state = vi.hoisted(() => ({
|
||||
requirePermission: vi.fn(async () => ({ id: 100, rank: 7, username: "staff" })),
|
||||
requirePermission: vi.fn(async () => ({
|
||||
id: 100,
|
||||
rank: 7,
|
||||
username: "staff",
|
||||
})),
|
||||
revalidatePath: vi.fn(),
|
||||
del: vi.fn(async () => [{ affectedRows: 1 }]),
|
||||
update: vi.fn(async () => [{ affectedRows: 1 }]),
|
||||
@@ -82,8 +86,14 @@ describe("soundtrack actions", () => {
|
||||
it("denies updates without the catalog edit permission", async () => {
|
||||
state.requirePermission.mockRejectedValueOnce(new Error("forbidden"));
|
||||
await expect(
|
||||
updateSoundtrack({ id: 12, name: "x", author: "y", track: "z", length: 1 }),
|
||||
updateSoundtrack({
|
||||
id: 12,
|
||||
name: "x",
|
||||
author: "y",
|
||||
track: "z",
|
||||
length: 1,
|
||||
}),
|
||||
).rejects.toThrow("forbidden");
|
||||
expect(state.update).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user