From c7e2f5ae06787483c8493966a600216c3498937b Mon Sep 17 00:00:00 2001 From: bkellam Date: Fri, 19 Sep 2025 17:27:36 -0700 Subject: [PATCH] fix tests --- packages/web/src/__mocks__/prisma.ts | 6 ++++-- packages/web/src/withAuthV2.test.ts | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/web/src/__mocks__/prisma.ts b/packages/web/src/__mocks__/prisma.ts index 66470017..4db4de46 100644 --- a/packages/web/src/__mocks__/prisma.ts +++ b/packages/web/src/__mocks__/prisma.ts @@ -1,6 +1,6 @@ import { SINGLE_TENANT_ORG_DOMAIN, SINGLE_TENANT_ORG_ID, SINGLE_TENANT_ORG_NAME } from '@/lib/constants'; import { ApiKey, Org, PrismaClient, User } from '@prisma/client'; -import { beforeEach } from 'vitest'; +import { beforeEach, vi } from 'vitest'; import { mockDeep, mockReset } from 'vitest-mock-extended'; beforeEach(() => { @@ -43,6 +43,8 @@ export const MOCK_USER: User = { updatedAt: new Date(), hashedPassword: null, emailVerified: null, - image: null + image: null, + permissionSyncedAt: null } +export const userScopedPrismaClientExtension = vi.fn(); \ No newline at end of file diff --git a/packages/web/src/withAuthV2.test.ts b/packages/web/src/withAuthV2.test.ts index 7056cbef..23d7d05b 100644 --- a/packages/web/src/withAuthV2.test.ts +++ b/packages/web/src/withAuthV2.test.ts @@ -188,6 +188,7 @@ describe('getAuthContext', () => { }, org: MOCK_ORG, role: OrgRole.MEMBER, + prisma: undefined, }); }); @@ -217,6 +218,7 @@ describe('getAuthContext', () => { }, org: MOCK_ORG, role: OrgRole.OWNER, + prisma: undefined, }); }); @@ -241,6 +243,7 @@ describe('getAuthContext', () => { }, org: MOCK_ORG, role: OrgRole.GUEST, + prisma: undefined, }); }); @@ -256,6 +259,7 @@ describe('getAuthContext', () => { user: undefined, org: MOCK_ORG, role: OrgRole.GUEST, + prisma: undefined, }); }); });