From 022ba7b8de1a279c51b5c45b7622345ee3484675 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Sat, 26 Mar 2022 02:22:28 +0100 Subject: [PATCH] fixes tests by passing stringifyISODates to createdDate and emailVerified --- __tests__/users/[id]/user.id.test.index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/__tests__/users/[id]/user.id.test.index.ts b/__tests__/users/[id]/user.id.test.index.ts index 246a8bf0a8..5d833747d4 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)} }); }); });