mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
refactor(core): Send active workflow IDs during license renewal (#9804)
This commit is contained in:
@@ -3,7 +3,11 @@ import Container from 'typedi';
|
||||
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
|
||||
|
||||
import * as testDb from '../../shared/testDb';
|
||||
import { createWorkflowWithTrigger, getAllWorkflows } from '../../shared/db/workflows';
|
||||
import {
|
||||
createWorkflowWithTrigger,
|
||||
createWorkflow,
|
||||
getAllWorkflows,
|
||||
} from '../../shared/db/workflows';
|
||||
|
||||
describe('WorkflowRepository', () => {
|
||||
beforeAll(async () => {
|
||||
@@ -67,4 +71,27 @@ describe('WorkflowRepository', () => {
|
||||
expect(after).toMatchObject([{ active: false }, { active: false }]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getActiveIds', () => {
|
||||
it('should return active workflow IDs', async () => {
|
||||
//
|
||||
// ARRANGE
|
||||
//
|
||||
const workflows = await Promise.all([
|
||||
createWorkflow({ active: true }),
|
||||
createWorkflow({ active: false }),
|
||||
createWorkflow({ active: false }),
|
||||
]);
|
||||
|
||||
//
|
||||
// ACT
|
||||
//
|
||||
const activeIds = await Container.get(WorkflowRepository).getActiveIds();
|
||||
|
||||
//
|
||||
// ASSERT
|
||||
//
|
||||
expect(activeIds).toEqual([workflows[0].id]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user