fix(test): fix petsExtendedFields vi.mock hoisting and invalid UUIDs
Two pre-existing bugs prevented petsExtendedFields.test.ts from running: 1. vi.mock factory referenced bare `and`, `eq`, `exists`, `or` variables that are undefined at hoist time — replaced with inline mock functions 2. CLIENT_ID/PET_ID used non-UUID strings but Zod schema requires uuid() All 36 test files (521 tests) now pass. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -21,8 +21,8 @@ const MANAGER: StaffRow = {
|
||||
|
||||
// ─── Mutable mock state ───────────────────────────────────────────────────────
|
||||
|
||||
const CLIENT_ID = "client-uuid-extended";
|
||||
const PET_ID = "pet-uuid-extended";
|
||||
const CLIENT_ID = "a0000000-0000-4000-8000-000000000001";
|
||||
const PET_ID = "b0000000-0000-4000-8000-000000000002";
|
||||
|
||||
let petRows: Record<string, unknown>[] = [];
|
||||
let appointmentRows: Record<string, unknown>[] = [];
|
||||
@@ -163,10 +163,10 @@ vi.mock("../db", () => {
|
||||
}),
|
||||
pets,
|
||||
appointments,
|
||||
and,
|
||||
eq,
|
||||
exists,
|
||||
or,
|
||||
and: (...conds: unknown[]) => conds,
|
||||
eq: (col: unknown, val: unknown) => ({ col, val }),
|
||||
exists: (q: unknown) => q,
|
||||
or: (...conds: unknown[]) => conds,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user