feat(core): Read ephemeral license from environment and clean up ee flags (#5808)

Co-authored-by: Cornelius Suermann <cornelius@n8n.io>
This commit is contained in:
Michael Auerswald
2023-03-31 13:51:38 +02:00
committed by GitHub
parent 3ae69337ee
commit 83aef17120
19 changed files with 75 additions and 92 deletions

View File

@@ -1,10 +1,10 @@
import Container from 'typedi';
import type { SuperAgentTest } from 'supertest';
import { v4 as uuid } from 'uuid';
import type { INode } from 'n8n-workflow';
import * as UserManagementHelpers from '@/UserManagement/UserManagementHelper';
import type { User } from '@db/entities/User';
import config from '@/config';
import * as utils from './shared/utils';
import * as testDb from './shared/testDb';
@@ -12,6 +12,7 @@ import { createWorkflow } from './shared/testDb';
import type { SaveCredentialFunction } from './shared/types';
import { makeWorkflow } from './shared/utils';
import { randomCredentialPayload } from './shared/random';
import { License } from '@/License';
let owner: User;
let member: User;
@@ -23,6 +24,7 @@ let saveCredential: SaveCredentialFunction;
let sharingSpy: jest.SpyInstance<boolean>;
beforeAll(async () => {
Container.get(License).isSharingEnabled = () => true;
const app = await utils.initTestServer({ endpointGroups: ['workflows'] });
const globalOwnerRole = await testDb.getGlobalOwnerRole();
@@ -42,8 +44,6 @@ beforeAll(async () => {
sharingSpy = jest.spyOn(UserManagementHelpers, 'isSharingEnabled').mockReturnValue(true);
await utils.initNodeTypes();
config.set('enterprise.features.sharing', true);
});
beforeEach(async () => {
@@ -51,6 +51,7 @@ beforeEach(async () => {
});
afterAll(async () => {
Container.reset();
await testDb.terminate();
});