refactor(core): Move some request DTOs to @n8n/api-types (no-changelog) (#10880)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-20 21:14:06 +02:00
committed by GitHub
parent 583d3a7acb
commit 769ddfdd1d
35 changed files with 648 additions and 316 deletions

View File

@@ -225,6 +225,29 @@ describe('Users in Public API', () => {
expect(response.body).toHaveProperty('message', 'Forbidden');
});
it('should return a 400 on invalid payload', async () => {
/**
* Arrange
*/
testServer.license.enable('feat:advancedPermissions');
const owner = await createOwner({ withApiKey: true });
const member = await createMember();
const payload = { newRoleName: 'invalid' };
/**
* Act
*/
const response = await testServer
.publicApiAgentFor(owner)
.patch(`/users/${member.id}/role`)
.send(payload);
/**
* Assert
*/
expect(response.status).toBe(400);
});
it("should change a user's role", async () => {
/**
* Arrange