lint: fix biome issues in new test files and helpers
CI / check (push) Failing after 34s
CI / preflight (push) Skipped
CI / deploy (push) Skipped

This commit is contained in:
openhands committed 2026-09-21 18:19:39 +02:00
1 parent 99eb3af17b
commit 93862c2275
41 files changed
+488 -314

No files matched your search

+5 -5
View File
@@ -43,12 +43,12 @@ vi.mock("@/lib/server-log", () => ({
logServerError: mockLogServerError,
}));
import { WebsiteShopArticles } from "@/lib/db";
import {
createShopArticle,
deleteShopArticle,
updateShopArticle,
} from "./admin-shop";
import { WebsiteShopArticles } from "@/lib/db";
function form(data: Record<string, string>): FormData {
const fd = new FormData();
@@ -157,7 +157,7 @@ describe("createShopArticle", () => {
});
it("logs the error and returns without redirecting on insert failure", async () => {
fakeDbConfig.fail = (kind: string) => (kind === "insert" ? true : false);
fakeDbConfig.fail = (kind: string) => kind === "insert";
await createShopArticle(form({ name: "Broken" }));
expect(mockLogServerError).toHaveBeenCalledWith(
"admin.shop_create_failed",
@@ -237,7 +237,7 @@ describe("updateShopArticle", () => {
});
it("logs the error and returns without rendering guards on failure", async () => {
fakeDbConfig.fail = (kind: string) => (kind === "update" ? true : false);
fakeDbConfig.fail = (kind: string) => kind === "update";
await updateShopArticle(form({ id: "1", name: "Broken" }));
expect(mockLogServerError).toHaveBeenCalledWith(
"admin.shop_update_failed",
@@ -273,7 +273,7 @@ describe("deleteShopArticle", () => {
});
it("logs the error and returns without redirecting on failure", async () => {
fakeDbConfig.fail = (kind: string) => (kind === "delete" ? true : false);
fakeDbConfig.fail = (kind: string) => kind === "delete";
await deleteShopArticle(form({ id: "3" }));
expect(mockLogServerError).toHaveBeenCalledWith(
"admin.shop_delete_failed",
@@ -282,4 +282,4 @@ describe("deleteShopArticle", () => {
);
expect(mockRedirect).not.toHaveBeenCalled();
});
});
});