Scheduling infrastructure for absolutely everyone.
fixes tests by passing stringifyISODates to createdDate and emailVerified
Agusti Fernandez Pardo022ba7b8de1a
diff --git a/__tests__/users/[id]/user.id.test.index.ts b/__tests__/users/[id]/user.id.test.index.tsindex 246a8bf0a82..5d833747d48 100644--- a/__tests__/users/[id]/user.id.test.index.ts+++ b/__tests__/users/[id]/user.id.test.index.ts@@ -2,6 +2,7 @@ import handleUser from "@api/users/[id]";import { createMocks } from "node-mocks-http";import prisma from "@calcom/prisma";+import { stringifyISODate } from "@lib/utils/stringifyISODate";describe("GET /api/users/[id] with valid id as string returns an user-type", () => {it("returns a message with the specified events", async () => {@@ -15,7 +16,7 @@ describe("GET /api/users/[id] with valid id as string returns an user-type", ()await handleUser(req, res);expect(res._getStatusCode()).toBe(200);- expect(JSON.parse(res._getData())).toStrictEqual({ data: user });+ expect(JSON.parse(res._getData())).toEqual({ data: {...user, createdDate: stringifyISODate(user?.createdDate), emailVerified: stringifyISODate(user?.emailVerified)} });});});