Scheduling infrastructure for absolutely everyone.
test: all flaky unit tests (#26558)
Anik Dhabal Babuf54a3d1d0cf4
diff --git a/packages/app-store/_utils/payments/handlePaymentSuccess.test.ts b/packages/app-store/_utils/payments/handlePaymentSuccess.test.tsindex 6ca01b54f77..3faf8593212 100644--- a/packages/app-store/_utils/payments/handlePaymentSuccess.test.ts+++ b/packages/app-store/_utils/payments/handlePaymentSuccess.test.ts@@ -74,6 +74,13 @@ vi.mock("@calcom/lib/logger", () => ({})),},}));+// Mock routing-forms modules to prevent async import issues during test teardown+vi.mock("@calcom/features/routing-forms/lib/findFieldValueByIdentifier", () => ({+ findFieldValueByIdentifier: vi.fn(),+}));+vi.mock("@calcom/app-store/routing-forms/lib/findFieldValueByIdentifier", () => ({+ findFieldValueByIdentifier: vi.fn(),+}));import { getBooking } from "@calcom/features/bookings/lib/payment/getBooking";import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";diff --git a/packages/features/bookings/lib/EventManager.test.ts b/packages/features/bookings/lib/EventManager.test.tsindex a45fc81a179..46f83d2b1dc 100644--- a/packages/features/bookings/lib/EventManager.test.ts+++ b/packages/features/bookings/lib/EventManager.test.ts@@ -2,6 +2,24 @@ import { prisma } from "@calcom/prisma/__mocks__/prisma";import { describe, expect, it, vi, beforeEach } from "vitest";+vi.mock("@calcom/features/watchlist/lib/utils/normalization", () => ({+ normalizeEmail: vi.fn(),+ extractDomainFromEmail: vi.fn(),+ normalizeDomain: vi.fn(),+}));+vi.mock("@calcom/features/watchlist/lib/service/GlobalBlockingService", () => ({+ GlobalBlockingService: vi.fn(),+}));+vi.mock("@calcom/features/watchlist/lib/freeEmailDomainCheck/checkIfFreeEmailDomain", () => ({+ checkIfFreeEmailDomain: vi.fn(),+}));+vi.mock("@calcom/features/watchlist/operations/check-if-users-are-blocked.controller", () => ({+ checkIfUsersAreBlocked: vi.fn(),+}));+vi.mock("@calcom/features/watchlist/lib/telemetry", () => ({+ sentrySpan: vi.fn(),+}));+import { CredentialRepository } from "@calcom/features/credentials/repositories/CredentialRepository";import { symmetricDecrypt } from "@calcom/lib/crypto";import type { DestinationCalendar } from "@calcom/prisma/client";diff --git a/packages/features/crmManager/crmManager.test.ts b/packages/features/crmManager/crmManager.test.tsindex 7e143fafffb..9ba35daafd7 100644--- a/packages/features/crmManager/crmManager.test.ts+++ b/packages/features/crmManager/crmManager.test.ts@@ -1,7 +1,22 @@import { mockCrmApp } from "@calcom/web/test/utils/bookingScenario/bookingScenario";import type { TFunction } from "i18next";-import { describe, expect, test, vi } from "vitest";+import { describe, expect, test, vi, afterEach } from "vitest";++vi.mock("@calcom/app-store/salesforce/lib/graphql/SalesforceGraphQLClient", () => ({+ SalesforceGraphQLClient: vi.fn(),+}));+vi.mock("@calcom/app-store/salesforce/lib/CrmService", () => ({+ default: vi.fn(),+}));+vi.mock("@urql/core", () => ({+ Client: vi.fn(),+ cacheExchange: vi.fn(),+ fetchExchange: vi.fn(),+}));+vi.mock("@urql/exchange-retry", () => ({+ retryExchange: vi.fn(),+}));import { getCrm } from "@calcom/app-store/_utils/getCrm";