mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
chore(core): Use roles from database in global roles (#17853)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { createWorkflow, testDb } from '@n8n/backend-test-utils';
|
||||
import type { User } from '@n8n/db';
|
||||
import { ProjectRepository, TestRunRepository } from '@n8n/db';
|
||||
import {
|
||||
GLOBAL_MEMBER_ROLE,
|
||||
GLOBAL_OWNER_ROLE,
|
||||
ProjectRepository,
|
||||
TestRunRepository,
|
||||
} from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import { mockInstance } from 'n8n-core/test/utils';
|
||||
import type { IWorkflowBase } from 'n8n-workflow';
|
||||
@@ -25,7 +30,7 @@ const testServer = utils.setupTestServer({
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
ownerShell = await createUserShell('global:owner');
|
||||
ownerShell = await createUserShell(GLOBAL_OWNER_ROLE);
|
||||
authOwnerAgent = testServer.authAgentFor(ownerShell);
|
||||
});
|
||||
|
||||
@@ -113,7 +118,7 @@ describe('GET /workflows/:workflowId/test-runs', () => {
|
||||
});
|
||||
|
||||
test('should retrieve list of test runs for a shared workflow', async () => {
|
||||
const memberShell = await createUserShell('global:member');
|
||||
const memberShell = await createUserShell(GLOBAL_MEMBER_ROLE);
|
||||
const memberAgent = testServer.authAgentFor(memberShell);
|
||||
const memberPersonalProject = await Container.get(
|
||||
ProjectRepository,
|
||||
@@ -171,7 +176,7 @@ describe('GET /workflows/:workflowId/test-runs/:id', () => {
|
||||
});
|
||||
|
||||
test('should retrieve test run of a shared workflow', async () => {
|
||||
const memberShell = await createUserShell('global:member');
|
||||
const memberShell = await createUserShell(GLOBAL_MEMBER_ROLE);
|
||||
const memberAgent = testServer.authAgentFor(memberShell);
|
||||
const memberPersonalProject = await Container.get(
|
||||
ProjectRepository,
|
||||
@@ -345,7 +350,7 @@ describe('GET /workflows/:workflowId/test-runs/:id/test-cases', () => {
|
||||
});
|
||||
|
||||
test('should return test cases for a shared workflow', async () => {
|
||||
const memberShell = await createUserShell('global:member');
|
||||
const memberShell = await createUserShell(GLOBAL_MEMBER_ROLE);
|
||||
const memberAgent = testServer.authAgentFor(memberShell);
|
||||
const memberPersonalProject = await Container.get(
|
||||
ProjectRepository,
|
||||
|
||||
Reference in New Issue
Block a user