mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Remove unnecessary info from GET /workflows response (#5311)
* fix(core): Remove unnecessary info from `GET /workflows` response * fix(core): Remove unnecessary info from `GET /workflows` response * fix(core): Remove credentials from `GET /workflows` response * fix(core): Update unit tests for `GET /workflows` response * fix(core): Remove `usedCredentials` from `GET /workflows` response * fix(core): Update unit tests for `GET /workflows` response * fix(core): remove nodes from getMany * fix(core): remove unnecessary owner props from workflow list items * fix(core): fix lint error * fix(core): remove unused function * fix(core): simplifying ownerId usage * fix(core): trim down the query for workflow listing
This commit is contained in:
@@ -151,7 +151,7 @@ describe('PUT /workflows/:id', () => {
|
||||
});
|
||||
|
||||
describe('GET /workflows', () => {
|
||||
test('should return workflows with ownership, sharing and credential usage details', async () => {
|
||||
test('should return workflows without nodes, sharing and credential usage details', async () => {
|
||||
const owner = await testDb.createUser({ globalRole: globalOwnerRole });
|
||||
const member = await testDb.createUser({ globalRole: globalMemberRole });
|
||||
|
||||
@@ -188,32 +188,11 @@ describe('GET /workflows', () => {
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(fetchedWorkflow.ownedBy).toMatchObject({
|
||||
id: owner.id,
|
||||
email: owner.email,
|
||||
firstName: owner.firstName,
|
||||
lastName: owner.lastName,
|
||||
});
|
||||
|
||||
expect(fetchedWorkflow.sharedWith).toHaveLength(1);
|
||||
|
||||
const [sharee] = fetchedWorkflow.sharedWith;
|
||||
|
||||
expect(sharee).toMatchObject({
|
||||
id: member.id,
|
||||
email: member.email,
|
||||
firstName: member.firstName,
|
||||
lastName: member.lastName,
|
||||
});
|
||||
|
||||
expect(fetchedWorkflow.usedCredentials).toHaveLength(1);
|
||||
|
||||
const [usedCredential] = fetchedWorkflow.usedCredentials;
|
||||
|
||||
expect(usedCredential).toMatchObject({
|
||||
id: savedCredential.id,
|
||||
name: savedCredential.name,
|
||||
type: savedCredential.type,
|
||||
currentUserHasAccess: true,
|
||||
});
|
||||
expect(fetchedWorkflow.sharedWith).not.toBeDefined()
|
||||
expect(fetchedWorkflow.usedCredentials).not.toBeDefined()
|
||||
expect(fetchedWorkflow.nodes).not.toBeDefined()
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user