Files
calendar/packages/lib/__mocks__/constants.ts
T
Hariom BalharaandGitHub 6670bbc1d7 fix: Error in team members migration during org onboarding (#15349)
* fix: Error in team members migration during org onboarding

* Add invitationMemberHandler tests

* Add unit tests

* Improve tests and refactor

* Improve tests and refactor

* Fix type issue

* Fix createNewUsersConnectToOrgIfExists args
2024-06-27 00:53:55 +00:00

29 lines
691 B
TypeScript

import { vi, beforeEach } from "vitest";
import type * as constants from "@calcom/lib/constants";
const mockedConstants = {
IS_PRODUCTION: false,
IS_TEAM_BILLING_ENABLED: false,
} as typeof constants;
vi.mock("@calcom/lib/constants", () => {
return mockedConstants;
});
beforeEach(() => {
Object.entries(mockedConstants).forEach(([key]) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete mockedConstants[key];
});
});
export const constantsScenarios = {
enableTeamBilling: () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
mockedConstants.IS_TEAM_BILLING_ENABLED = true;
},
};