feat(lib): add more tests to lib package (#7210)

* feat(lib): add more tests to lib package

Add more tests to the lib package to make it more robust overall. Additionally, tidy any methods that can be modified without changing behaviour and tighten types where possible.

* fix(lib): update missed imports

* fix: revert stylistic changes

* Update getSchedule.test.ts

---------

Co-authored-by: Omar López <[email protected]>
This commit is contained in:
Lucas SmithandOmar López authored and GitHub committed 2023-03-10 22:10:56 +00:00
1 parent cbc9cd60d5
commit d81d772cdf
28 files changed
+675 -193

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ import crypto from "crypto";
import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";
import { getPlaceholderAvatar } from "@calcom/lib/getPlaceholderAvatar";
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
import prisma from "@calcom/prisma";
import { defaultAvatarSrc } from "@lib/profile";
+1 -1
View File
@@ -7,7 +7,7 @@ import { useEffect } from "react";
import { useIsEmbed } from "@calcom/embed-core/embed-iframe";
import EventTypeDescription from "@calcom/features/eventtypes/components/EventTypeDescription";
import { CAL_URL } from "@calcom/lib/constants";
import { getPlaceholderAvatar } from "@calcom/lib/getPlaceholderAvatar";
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useTheme from "@calcom/lib/hooks/useTheme";
import { md } from "@calcom/lib/markdownIt";
+1
View File
@@ -504,6 +504,7 @@ describe("getSchedule", () => {
);
});
// FIXME: Fix minimumBookingNotice is respected test
test.skip("minimumBookingNotice is respected", async () => {
jest.useFakeTimers().setSystemTime(
(() => {