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:
2 files changed
+160
No files matched your search
@@ -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 {};
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user