@@ -11,9 +11,9 @@ import { getEventTypesFromDB } from "@calcom/features/bookings/lib/handleNewBook
1111import sendPayload from "@calcom/features/webhooks/lib/sendOrSchedulePayload" ;
1212import { ErrorCode } from "@calcom/lib/errorCodes" ;
1313import { buildBooking , buildEventType , buildWebhook , buildUser } from "@calcom/lib/test/builder" ;
14- import prisma from "@calcom/prisma" ;
14+ import { prisma } from "@calcom/prisma" ;
1515import type { Booking } from "@calcom/prisma/client" ;
16- import { CreationSource } from "@calcom/prisma/enums" ;
16+ import { CreationSource , BookingStatus } from "@calcom/prisma/enums" ;
1717
1818import handler from "../../../pages/api/bookings/_post" ;
1919
@@ -303,6 +303,7 @@ describe("POST /api/bookings", () => {
303303
304304 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
305305 ...buildEventType ( { recurringEvent : { freq : 2 , count : 12 , interval : 1 } } ) ,
306+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
306307 profile : { organizationId : null } ,
307308 hosts : [ ] ,
308309 users : [ buildUser ( ) ] ,
@@ -340,6 +341,7 @@ describe("POST /api/bookings", () => {
340341
341342 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
342343 ...buildEventType ( { recurringEvent : { freq : 2 , count : 12 , interval : 1 } } ) ,
344+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
343345 profile : { organizationId : null } ,
344346 hosts : [ ] ,
345347 users : [ buildUser ( ) ] ,
@@ -376,6 +378,7 @@ describe("POST /api/bookings", () => {
376378
377379 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
378380 ...buildEventType ( { profileId : null } ) ,
381+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
379382 profile : { organizationId : null } ,
380383 hosts : [ ] ,
381384 users : [ buildUser ( ) ] ,
@@ -417,6 +420,7 @@ describe("POST /api/bookings", () => {
417420
418421 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
419422 ...buildEventType ( { profileId : null , length : 15 } ) ,
423+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
420424 profile : { organizationId : null } ,
421425 hosts : [ ] ,
422426 users : [ buildUser ( ) ] ,
@@ -468,7 +472,7 @@ describe("POST /api/bookings", () => {
468472
469473 prismaMock . booking . findUnique . mockResolvedValue ( {
470474 ...originalBooking ,
471- status : "cancelled " ,
475+ status : "CANCELLED " ,
472476 } ) ;
473477
474478 const { req, res } = createMocks < CustomNextApiRequest , CustomNextApiResponse > ( {
@@ -492,6 +496,7 @@ describe("POST /api/bookings", () => {
492496
493497 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
494498 ...buildEventType ( { profileId : null , length : 15 } ) ,
499+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
495500 profile : { organizationId : null } ,
496501 hosts : [ ] ,
497502 users : [ buildUser ( ) ] ,
@@ -532,7 +537,7 @@ describe("POST /api/bookings", () => {
532537 const previousBooking = await prisma . booking . findUnique ( {
533538 where : { uid : "original-booking-uid" } ,
534539 } ) ;
535- expect ( previousBooking ?. status ) . toBe ( "cancelled" ) ;
540+ expect ( previousBooking ?. status ) . toBe ( BookingStatus . CANCELLED ) ;
536541 } ) ;
537542
538543 test ( "Creates source as api_v1" , async ( ) => {
@@ -556,6 +561,7 @@ describe("POST /api/bookings", () => {
556561
557562 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
558563 ...buildEventType ( { profileId : null , length : 15 } ) ,
564+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
559565 profile : { organizationId : null } ,
560566 hosts : [ ] ,
561567 users : [ buildUser ( ) ] ,
@@ -627,6 +633,7 @@ describe("POST /api/bookings", () => {
627633
628634 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
629635 ...buildEventType ( { profileId : null , length : 15 } ) ,
636+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
630637 profile : { organizationId : null } ,
631638 hosts : [ ] ,
632639 users : [ buildUser ( ) ] ,
@@ -684,6 +691,7 @@ describe("POST /api/bookings", () => {
684691
685692 prismaMock . eventType . findUniqueOrThrow . mockResolvedValue ( {
686693 ...buildEventType ( { recurringEvent : { freq : 2 , count : 12 , interval : 1 } } ) ,
694+ // @ts -expect-error requires mockDeep which will be introduced in the Prisma 6.7.0 upgrade, ignore for now.
687695 profile : { organizationId : null } ,
688696 hosts : [ ] ,
689697 users : [ buildUser ( ) ] ,
0 commit comments