test(editor): Fix failing licensing related e2e specs (no-changelog) (#5884)

test(editor): Fix failing licensing related specs
This commit is contained in:
OlegIvaniv 2023-04-03 09:49:55 +02:00 committed by GitHub
parent fd48b049e5
commit d9f1e1e1ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View file

@ -26,7 +26,7 @@ describe('Log Streaming Settings', () => {
});
it('should show the licensed view when the feature is enabled', () => {
cy.enableFeature('logStreaming');
cy.enableFeature('feat:logStreaming');
cy.visit('/settings/log-streaming');
settingsLogStreamingPage.getters.getActionBoxLicensed().should('be.visible');
settingsLogStreamingPage.getters.getAddFirstDestinationButton().should('be.visible');

View file

@ -15,6 +15,7 @@ import { hashPassword } from '@/UserManagement/UserManagementHelper';
import { eventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import Container from 'typedi';
import { License } from '../License';
import { LICENSE_FEATURES } from '@/constants';
if (process.env.E2E_TESTS !== 'true') {
console.error('E2E endpoints only allowed during E2E tests');
@ -22,11 +23,11 @@ if (process.env.E2E_TESTS !== 'true') {
}
const enabledFeatures = {
sharing: true, //default to true here instead of setting it in config/index.ts for e2e
ldap: false,
saml: false,
logStreaming: false,
advancedExecutionFilters: false,
[LICENSE_FEATURES.SHARING]: true, //default to true here instead of setting it in config/index.ts for e2e
[LICENSE_FEATURES.LDAP]: false,
[LICENSE_FEATURES.SAML]: false,
[LICENSE_FEATURES.LOG_STREAMING]: false,
[LICENSE_FEATURES.ADVANCED_EXECUTION_FILTERS]: false,
};
type Feature = keyof typeof enabledFeatures;
@ -93,7 +94,7 @@ const setupUserManagement = async () => {
};
const resetLogStreaming = async () => {
enabledFeatures.logStreaming = false;
enabledFeatures[LICENSE_FEATURES.LOG_STREAMING] = false;
for (const id in eventBus.destinations) {
await eventBus.removeDestination(id);
}