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,6 +1,5 @@
|
||||
import { eq } from "drizzle-orm";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { fakeForm } from "@/test/fake-form";
|
||||
|
||||
const state = vi.hoisted(() => ({
|
||||
deletes: [] as { table: unknown; where: unknown }[],
|
||||
@@ -87,7 +86,6 @@ vi.mock("@/lib/db", async () => {
|
||||
});
|
||||
|
||||
import { CatalogItemsBc } from "@/lib/db";
|
||||
import { PERMS } from "@/lib/permissions";
|
||||
import {
|
||||
createBcItem,
|
||||
createBcPage,
|
||||
@@ -110,7 +108,10 @@ beforeEach(() => {
|
||||
mockWithCatalogExport.mockImplementation(
|
||||
async (fn: () => unknown) => await fn(),
|
||||
);
|
||||
mockCatalogFailure.mockReturnValue({ message: "Catalog op failed", status: 400 });
|
||||
mockCatalogFailure.mockReturnValue({
|
||||
message: "Catalog op failed",
|
||||
status: 400,
|
||||
});
|
||||
mockCreateBcOfferCommand.mockResolvedValue(501);
|
||||
mockCreatePageCommand.mockResolvedValue(201);
|
||||
mockSendCatalogUpdate.mockResolvedValue({});
|
||||
@@ -265,7 +266,12 @@ describe("toggleBcPage", () => {
|
||||
it("toggles the requested field", async () => {
|
||||
const result = await toggleBcPage({ id: 2, field: "visible" });
|
||||
expect(result).toEqual({ ok: true });
|
||||
expect(mockTogglePageCommand).toHaveBeenCalledWith("bc", 2, "visible", staff.id);
|
||||
expect(mockTogglePageCommand).toHaveBeenCalledWith(
|
||||
"bc",
|
||||
2,
|
||||
"visible",
|
||||
staff.id,
|
||||
);
|
||||
expect(mockSendCatalogUpdate).toHaveBeenCalled();
|
||||
expect(mockRevalidatePath).toHaveBeenCalledWith(
|
||||
"/admin/catalog/builder-club",
|
||||
@@ -377,4 +383,4 @@ describe("reorderBcCatalogPages", () => {
|
||||
"/admin/catalog/builder-club",
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user