From fcb0fce7997851e5359b31ea689fcb17a8e4852b Mon Sep 17 00:00:00 2001 From: zomars Date: Fri, 26 May 2023 14:14:49 -0700 Subject: [PATCH] Migrates missing jest test to vitest --- apps/api/test/lib/bookings/_post.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/api/test/lib/bookings/_post.test.ts b/apps/api/test/lib/bookings/_post.test.ts index 95bf7a73d5..5e4b17f23d 100644 --- a/apps/api/test/lib/bookings/_post.test.ts +++ b/apps/api/test/lib/bookings/_post.test.ts @@ -1,19 +1,20 @@ import type { Request, Response } from "express"; import type { NextApiRequest, NextApiResponse } from "next"; import { createMocks } from "node-mocks-http"; +import { describe, expect, test, vi } from "vitest"; import dayjs from "@calcom/dayjs"; import sendPayload from "@calcom/features/webhooks/lib/sendPayload"; import { buildBooking, buildEventType, buildWebhook } from "@calcom/lib/test/builder"; import prisma from "@calcom/prisma"; -import { prismaMock } from "../../../../../tests/config/singleton"; +import prismaMock from "../../../../../tests/libs/__mocks__/prisma"; import handler from "../../../pages/api/bookings/_post"; type CustomNextApiRequest = NextApiRequest & Request; type CustomNextApiResponse = NextApiResponse & Response; -jest.mock("@calcom/features/webhooks/lib/sendPayload"); -jest.mock("@calcom/lib/server/i18n", () => { +vi.mock("@calcom/features/webhooks/lib/sendPayload"); +vi.mock("@calcom/lib/server/i18n", () => { return { getTranslation: (key: string) => key, }; @@ -151,7 +152,7 @@ describe("POST /api/bookings", () => { }); }); - xdescribe("Success", () => { + describe("Success", () => { describe("Regular event-type", () => { test("Creates one single booking", async () => { const { req, res } = createMocks({