fixes tests by passing stringifyISODates to createdDate and emailVerified

This commit is contained in:
Agusti Fernandez Pardo committed 2022-03-26 02:22:28 +01:00
1 parent 62a917c7a8
commit 022ba7b8de
1 file changed
+2 -1
+2 -1
View File
@@ -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)} });
});
});