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
@@ -20,7 +20,10 @@ const actionErrorClass = vi.hoisted(
|
||||
);
|
||||
|
||||
vi.mock("@/lib/safe-action", () => ({
|
||||
adminAction: (opts: { permission?: string | readonly string[]; schema?: z.ZodType }, handler: (ctx: any) => unknown) => {
|
||||
adminAction: (
|
||||
opts: { permission?: string | readonly string[]; schema?: z.ZodType },
|
||||
handler: (ctx: any) => unknown,
|
||||
) => {
|
||||
return async (input: unknown) => {
|
||||
const needed = Array.isArray(opts.permission)
|
||||
? opts.permission
|
||||
@@ -140,12 +143,14 @@ describe("createTemplate", () => {
|
||||
});
|
||||
|
||||
it("rejects empty titles and content", async () => {
|
||||
expect(
|
||||
await createTemplate({ title: "", content: "x" }),
|
||||
).toMatchObject({ ok: false, error: "Validation failed" });
|
||||
expect(
|
||||
await createTemplate({ title: "T", content: "" }),
|
||||
).toMatchObject({ ok: false, error: "Validation failed" });
|
||||
expect(await createTemplate({ title: "", content: "x" })).toMatchObject({
|
||||
ok: false,
|
||||
error: "Validation failed",
|
||||
});
|
||||
expect(await createTemplate({ title: "T", content: "" })).toMatchObject({
|
||||
ok: false,
|
||||
error: "Validation failed",
|
||||
});
|
||||
});
|
||||
|
||||
it("requires the tickets edit permission", async () => {
|
||||
@@ -203,4 +208,4 @@ describe("deleteTemplate", () => {
|
||||
error: "Unauthorized",
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user