mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-17 14:55:24 +00:00
fix tests
This commit is contained in:
parent
344ff5f100
commit
c7e2f5ae06
2 changed files with 8 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { SINGLE_TENANT_ORG_DOMAIN, SINGLE_TENANT_ORG_ID, SINGLE_TENANT_ORG_NAME } from '@/lib/constants';
|
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 { ApiKey, Org, PrismaClient, User } from '@prisma/client';
|
||||||
import { beforeEach } from 'vitest';
|
import { beforeEach, vi } from 'vitest';
|
||||||
import { mockDeep, mockReset } from 'vitest-mock-extended';
|
import { mockDeep, mockReset } from 'vitest-mock-extended';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
@ -43,6 +43,8 @@ export const MOCK_USER: User = {
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
hashedPassword: null,
|
hashedPassword: null,
|
||||||
emailVerified: null,
|
emailVerified: null,
|
||||||
image: null
|
image: null,
|
||||||
|
permissionSyncedAt: null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const userScopedPrismaClientExtension = vi.fn();
|
||||||
|
|
@ -188,6 +188,7 @@ describe('getAuthContext', () => {
|
||||||
},
|
},
|
||||||
org: MOCK_ORG,
|
org: MOCK_ORG,
|
||||||
role: OrgRole.MEMBER,
|
role: OrgRole.MEMBER,
|
||||||
|
prisma: undefined,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -217,6 +218,7 @@ describe('getAuthContext', () => {
|
||||||
},
|
},
|
||||||
org: MOCK_ORG,
|
org: MOCK_ORG,
|
||||||
role: OrgRole.OWNER,
|
role: OrgRole.OWNER,
|
||||||
|
prisma: undefined,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -241,6 +243,7 @@ describe('getAuthContext', () => {
|
||||||
},
|
},
|
||||||
org: MOCK_ORG,
|
org: MOCK_ORG,
|
||||||
role: OrgRole.GUEST,
|
role: OrgRole.GUEST,
|
||||||
|
prisma: undefined,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -256,6 +259,7 @@ describe('getAuthContext', () => {
|
||||||
user: undefined,
|
user: undefined,
|
||||||
org: MOCK_ORG,
|
org: MOCK_ORG,
|
||||||
role: OrgRole.GUEST,
|
role: OrgRole.GUEST,
|
||||||
|
prisma: undefined,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue