Skip to content

Commit c7e2f5a

Browse files
fix tests
1 parent 344ff5f commit c7e2f5a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/web/src/__mocks__/prisma.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SINGLE_TENANT_ORG_DOMAIN, SINGLE_TENANT_ORG_ID, SINGLE_TENANT_ORG_NAME } from '@/lib/constants';
22
import { ApiKey, Org, PrismaClient, User } from '@prisma/client';
3-
import { beforeEach } from 'vitest';
3+
import { beforeEach, vi } from 'vitest';
44
import { mockDeep, mockReset } from 'vitest-mock-extended';
55

66
beforeEach(() => {
@@ -43,6 +43,8 @@ export const MOCK_USER: User = {
4343
updatedAt: new Date(),
4444
hashedPassword: null,
4545
emailVerified: null,
46-
image: null
46+
image: null,
47+
permissionSyncedAt: null
4748
}
4849

50+
export const userScopedPrismaClientExtension = vi.fn();

packages/web/src/withAuthV2.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ describe('getAuthContext', () => {
188188
},
189189
org: MOCK_ORG,
190190
role: OrgRole.MEMBER,
191+
prisma: undefined,
191192
});
192193
});
193194

@@ -217,6 +218,7 @@ describe('getAuthContext', () => {
217218
},
218219
org: MOCK_ORG,
219220
role: OrgRole.OWNER,
221+
prisma: undefined,
220222
});
221223
});
222224

@@ -241,6 +243,7 @@ describe('getAuthContext', () => {
241243
},
242244
org: MOCK_ORG,
243245
role: OrgRole.GUEST,
246+
prisma: undefined,
244247
});
245248
});
246249

@@ -256,6 +259,7 @@ describe('getAuthContext', () => {
256259
user: undefined,
257260
org: MOCK_ORG,
258261
role: OrgRole.GUEST,
262+
prisma: undefined,
259263
});
260264
});
261265
});

0 commit comments

Comments
 (0)