mock getIsSpamProtectionEnabled function

This commit is contained in:
Matthias Nannt
2025-05-10 18:22:18 +02:00
parent 2ab2be5801
commit 620b91f22a

View File

@@ -394,18 +394,8 @@ export const getIsSamlSsoEnabled = async (): Promise<boolean> => {
export const getIsSpamProtectionEnabled = async (
billingPlan: Organization["billing"]["plan"]
): Promise<boolean> => {
if (!IS_RECAPTCHA_CONFIGURED) return false;
if (E2E_TESTING) {
const previousResult = await fetchLicenseForE2ETesting();
return previousResult?.features ? previousResult.features.spamProtection : false;
}
if (IS_FORMBRICKS_CLOUD)
return billingPlan === PROJECT_FEATURE_KEYS.SCALE || billingPlan === PROJECT_FEATURE_KEYS.ENTERPRISE;
const licenseFeatures = await getLicenseFeatures();
if (!licenseFeatures) return false;
return licenseFeatures.spamProtection;
logger.debug(billingPlan);
return false;
};
export const getOrganizationProjectsLimit = async (