Refactored buildSlots (#6389)
* Refactored buildSlots * Added typing for computedAvailableSlots * Adds very simple boundary logic to make sure slots start at the right times * Logic was cutting off too early * Woops, should be eventLength, not frequency * Expect 12:15 slots as availability is till 12:30 for booking * Deliberately skip test for testing purposes * slotInterval overrides intervals, but not duration * Fix calendar mocking * Another 45m length * Unskip :( * Fix test Co-authored-by: Hariom Balhara <[email protected]> Co-authored-by: Omar López <[email protected]>
This commit is contained in:
7 files changed
+179
-209
No files matched your search
@@ -1,8 +1,11 @@
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { mockDeep, mockReset, DeepMockProxy } from "jest-mock-extended";
|
||||
|
||||
import * as CalendarManager from "@calcom/core/CalendarManager";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
jest.mock("@calcom/core/CalendarManager");
|
||||
|
||||
jest.mock("@calcom/prisma", () => ({
|
||||
__esModule: true,
|
||||
default: mockDeep<PrismaClient>(),
|
||||
@@ -13,3 +16,4 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
export const prismaMock = prisma as unknown as DeepMockProxy<PrismaClient>;
|
||||
export const CalendarManagerMock = CalendarManager as unknown as DeepMockProxy<typeof CalendarManager>;
|
||||
Reference in new issue
Block a user