Migrates missing jest test to vitest

This commit is contained in:
zomars
2023-05-26 14:15:01 -07:00
parent fcb06f82d9
commit fcb0fce799
+5 -4
View File
@@ -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<CustomNextApiRequest, CustomNextApiResponse>({