test: Reset numeric features as well between e2e tests (#12542)

This commit is contained in:
Danny Martini 2025-01-09 18:08:49 +01:00 committed by GitHub
parent 8a42d55d91
commit 95f055d23a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,7 +103,7 @@ export class E2EController {
[LICENSE_FEATURES.AI_CREDITS]: false,
};
private numericFeatures: Record<NumericLicenseFeature, number> = {
private static readonly numericFeaturesDefaults: Record<NumericLicenseFeature, number> = {
[LICENSE_QUOTAS.TRIGGER_LIMIT]: -1,
[LICENSE_QUOTAS.VARIABLES_LIMIT]: -1,
[LICENSE_QUOTAS.USERS_LIMIT]: -1,
@ -112,6 +112,19 @@ export class E2EController {
[LICENSE_QUOTAS.AI_CREDITS]: 0,
};
private numericFeatures: Record<NumericLicenseFeature, number> = {
[LICENSE_QUOTAS.TRIGGER_LIMIT]:
E2EController.numericFeaturesDefaults[LICENSE_QUOTAS.TRIGGER_LIMIT],
[LICENSE_QUOTAS.VARIABLES_LIMIT]:
E2EController.numericFeaturesDefaults[LICENSE_QUOTAS.VARIABLES_LIMIT],
[LICENSE_QUOTAS.USERS_LIMIT]: E2EController.numericFeaturesDefaults[LICENSE_QUOTAS.USERS_LIMIT],
[LICENSE_QUOTAS.WORKFLOW_HISTORY_PRUNE_LIMIT]:
E2EController.numericFeaturesDefaults[LICENSE_QUOTAS.WORKFLOW_HISTORY_PRUNE_LIMIT],
[LICENSE_QUOTAS.TEAM_PROJECT_LIMIT]:
E2EController.numericFeaturesDefaults[LICENSE_QUOTAS.TEAM_PROJECT_LIMIT],
[LICENSE_QUOTAS.AI_CREDITS]: E2EController.numericFeaturesDefaults[LICENSE_QUOTAS.AI_CREDITS],
};
constructor(
license: License,
private readonly settingsRepo: SettingsRepository,
@ -181,6 +194,11 @@ export class E2EController {
for (const feature of Object.keys(this.enabledFeatures)) {
this.enabledFeatures[feature as BooleanLicenseFeature] = false;
}
for (const feature of Object.keys(this.numericFeatures)) {
this.numericFeatures[feature as NumericLicenseFeature] =
E2EController.numericFeaturesDefaults[feature as NumericLicenseFeature];
}
}
private async removeActiveWorkflows() {