mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
fix(core): Add optional context parameter to track creation source for workflows, credentials, and projects (#18736)
Co-authored-by: r00gm <raul00gm@gmail.com>
This commit is contained in:
@@ -398,6 +398,23 @@ describe('POST /projects/', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('should create a team project with context parameter', async () => {
|
||||
const ownerUser = await createOwner();
|
||||
const ownerAgent = testServer.authAgentFor(ownerUser);
|
||||
|
||||
const resp = await ownerAgent.post('/projects/').send({
|
||||
name: 'Test Team Project with Context',
|
||||
uiContext: 'universal_button',
|
||||
});
|
||||
expect(resp.status).toBe(200);
|
||||
const respProject = resp.body.data as Project;
|
||||
expect(respProject.name).toEqual('Test Team Project with Context');
|
||||
expect(async () => {
|
||||
await findProject(respProject.id);
|
||||
}).not.toThrow();
|
||||
expect(resp.body.data.role).toBe('project:admin');
|
||||
});
|
||||
|
||||
test('should allow to create a team projects if below the quota', async () => {
|
||||
testServer.license.setQuota('quota:maxTeamProjects', 1);
|
||||
const ownerUser = await createOwner();
|
||||
|
||||
Reference in New Issue
Block a user