fix tests

This commit is contained in:
2026-04-08 01:02:45 +00:00
parent 24f303355b
commit 5d378ccb56
16 changed files with 819 additions and 137 deletions
+14 -11
View File
@@ -237,7 +237,8 @@ export function buildMockUser(overrides: Record<string, any> = {}) {
return {
id: "user-1",
userId: "ms-uid-1",
name: "Test User",
firstName: "Test",
lastName: "User",
login: "test@example.com",
email: "test@example.com",
emailVerified: null,
@@ -270,6 +271,7 @@ export function buildMockCompany(overrides: Record<string, any> = {}) {
return {
id: 123,
uid: "company-1",
identifier: "TestCo",
name: "Test Company",
phone: "555-1234",
website: "https://test.com",
@@ -334,7 +336,7 @@ export function buildMockCredential(overrides: Record<string, any> = {}) {
name: "Test Credential",
notes: null,
typeId: ctype.id,
companyId: company.id,
companyId: company.uid,
subCredentialOfId: null,
fields: { username: "admin" },
type: ctype,
@@ -379,6 +381,7 @@ export function buildMockOpportunity(overrides: Record<string, any> = {}) {
notes: "Some notes",
typeId: 1,
type: { id: 1, name: "New Business" },
stage: { id: 2, name: "Proposal" },
stageName: "Proposal",
stageCwId: 2,
statusId: 3,
@@ -398,7 +401,7 @@ export function buildMockOpportunity(overrides: Record<string, any> = {}) {
secondarySalesRepCwId: null,
companyCwId: 123,
companyName: "Test Company",
companyId: "company-1",
companyId: 123,
contactCwId: 200,
contactName: "Jane Doe",
siteCwId: 300,
@@ -517,19 +520,19 @@ export function buildMockGeneratedQuote(overrides: Record<string, any> = {}) {
/** Build a minimal Prisma-shaped CatalogItem row. */
export function buildMockCatalogItem(overrides: Record<string, any> = {}) {
return {
id: "cat-1",
cwCatalogId: 500,
id: 500,
uid: "cat-1",
identifier: "USW-Pro-24",
name: "UniFi Switch Pro 24",
description: "24-port managed switch",
customerDescription: "Enterprise switch",
internalNotes: null,
category: "Technology",
categoryCwId: 18,
subcategory: "Network-Switch",
subcategoryCwId: 112,
manufacturer: "Ubiquiti",
manufactureCwId: 248,
subcategory: {
id: 112,
name: "Network-Switch",
category: { id: 18, name: "Technology" },
},
manufacturer: { id: 248, name: "Ubiquiti" },
partNumber: "USW-Pro-24",
vendorName: "Ubiquiti Inc",
vendorSku: "USW-Pro-24",