test: Create unit tests for react components in packages/ui/components/createButton (#10644)

Co-authored-by: gitstart-calcom <[email protected]>
Co-authored-by: Shivam Kalra <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-08-18 14:22:14 +05:30
1 parent b44f4d66f9
commit 2403d77166
2 files changed
+160

No files matched your search

+38
View File
@@ -2,6 +2,44 @@ import matchers from "@testing-library/jest-dom/matchers";
import { cleanup } from "@testing-library/react";
import { afterEach, expect, vi } from "vitest";
vi.mock("next-auth/react", () => ({
useSession() {
return {};
},
}));
vi.mock("@calcom/features/ee/organizations/hooks", () => ({
useOrgBrandingValues() {
return {};
},
}));
vi.mock("@calcom/features/ee/organizations/context/provider", () => ({
useOrgBranding() {
return {};
},
}));
vi.mock("@calcom/trpc/react", () => ({
trpc: {},
}));
vi.mock("next/navigation", async () => ({
...((await vi.importActual("next/navigation")) as object),
useRouter() {
return {
route: "/",
pathname: "",
query: {},
asPath: "",
push: vi.fn(),
};
},
useSearchParams() {
return new URLSearchParams();
},
}));
vi.mock("@calcom/lib/OgImages", async () => {
return {};
});