test: all flaky unit tests (#26558)
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user