mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Get workflow not returning home project and shared projects (no-changelog) (#9815)
This commit is contained in:
@@ -527,6 +527,35 @@ describe('GET /workflows/:workflowId', () => {
|
||||
]);
|
||||
expect(member2Workflow.sharedWithProjects).toHaveLength(1);
|
||||
});
|
||||
|
||||
test('should return workflow credentials home project and shared with projects', async () => {
|
||||
const savedCredential = await saveCredential(randomCredentialPayload(), { user: member });
|
||||
// Both users have access to the credential (none is owner)
|
||||
await shareCredentialWithUsers(savedCredential, [anotherMember]);
|
||||
|
||||
const workflowPayload = makeWorkflow({
|
||||
withPinData: false,
|
||||
withCredential: { id: savedCredential.id, name: savedCredential.name },
|
||||
});
|
||||
const workflow = await createWorkflow(workflowPayload, member);
|
||||
await shareWorkflowWithUsers(workflow, [anotherMember]);
|
||||
|
||||
const responseMember1 = await authMemberAgent.get(`/workflows/${workflow.id}`).expect(200);
|
||||
const member1Workflow: WorkflowWithSharingsMetaDataAndCredentials = responseMember1.body.data;
|
||||
|
||||
expect(member1Workflow.usedCredentials).toMatchObject([
|
||||
{
|
||||
id: savedCredential.id,
|
||||
name: savedCredential.name,
|
||||
currentUserHasAccess: true,
|
||||
homeProject: {
|
||||
id: memberPersonalProject.id,
|
||||
},
|
||||
sharedWithProjects: [{ id: anotherMemberPersonalProject.id }],
|
||||
},
|
||||
]);
|
||||
expect(member1Workflow.sharedWithProjects).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /workflows', () => {
|
||||
|
||||
Reference in New Issue
Block a user