Skip to content

Commit

Permalink
Fix ui import mockig that got broken after the last merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hariombalhara committed Sep 3, 2024
1 parent 2c23e6b commit a2984bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "@calcom/ui/__mocks__/ui";

import { TooltipProvider } from "@radix-ui/react-tooltip";
import { render, fireEvent, screen } from "@testing-library/react";
import * as React from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { cleanup } from "@testing-library/react";
import { afterEach, vi } from "vitest";
import { vi } from "vitest";

vi.mock("@calcom/ui", async (originalImport) => {
const original = (await originalImport()) as Record<string, unknown>;
Expand All @@ -11,6 +10,4 @@ vi.mock("@calcom/ui", async (originalImport) => {
};
});

afterEach(() => {
cleanup();
});
export {};
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"./components/icon/SatSymbol": "./components/icon/SatSymbol.tsx",
"./components/icon/Spinner": "./components/icon/Spinner.tsx",
"./components/unpublished-entity/UnpublishedEntity": "./components/unpublished-entity/index.ts",
"./components/form/timezone-select/TimezoneSelect": "./components/form/timezone-select/index.ts"
"./components/form/timezone-select/TimezoneSelect": "./components/form/timezone-select/index.ts",
"./__mocks__/ui": "./__mocks__/ui.tsx"
},
"types": "./index.tsx",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions vitest.workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ const workspaces = packagedEmbedTestsOnly
name: "@calcom/features/form-builder",
include: ["packages/features/form-builder/**/*.{test,spec}.[jt]s?(x)"],
environment: "jsdom",
setupFiles: ["@calcom/features/form-builder/test-setup.ts"],
setupFiles: ["packages/ui/components/test-setup.ts"],
},
},
{
test: {
globals: true,
name: "@calcom/features/bookings",
include: ["packages/features/bookings/**/*.{test,spec}.[jt]s?(x)"],
include: ["packages/features/bookings/**/*.{test,spec}.[jt]sx"],
environment: "jsdom",
setupFiles: ["packages/ui/components/test-setup.ts"],
},
Expand Down

0 comments on commit a2984bb

Please sign in to comment.