-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathprisma.ts
More file actions
48 lines (42 loc) · 1.17 KB
/
prisma.ts
File metadata and controls
48 lines (42 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 { mockDeep, mockReset } from 'vitest-mock-extended';
beforeEach(() => {
mockReset(prisma);
});
export const prisma = mockDeep<PrismaClient>();
export const MOCK_ORG: Org = {
id: SINGLE_TENANT_ORG_ID,
name: SINGLE_TENANT_ORG_NAME,
domain: SINGLE_TENANT_ORG_DOMAIN,
createdAt: new Date(),
updatedAt: new Date(),
isOnboarded: true,
imageUrl: null,
metadata: null,
memberApprovalRequired: false,
stripeCustomerId: null,
stripeSubscriptionStatus: null,
stripeLastUpdatedAt: null,
inviteLinkEnabled: false,
inviteLinkId: null
}
export const MOCK_API_KEY: ApiKey = {
name: 'Test API Key',
hash: 'apikey',
createdAt: new Date(),
lastUsedAt: new Date(),
orgId: 1,
createdById: '1',
}
export const MOCK_USER: User = {
id: '1',
name: 'Test User',
email: 'test@test.com',
createdAt: new Date(),
updatedAt: new Date(),
hashedPassword: null,
emailVerified: null,
image: null
}