mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Use POST /users to re-invite users (no-changelog) (#7714)
This commit is contained in:
@@ -655,26 +655,3 @@ describe('POST /users', () => {
|
||||
assertInviteUserErrorResponse(invitationResponse);
|
||||
});
|
||||
});
|
||||
|
||||
describe('POST /users/:id/reinvite', () => {
|
||||
test('should send reinvite, but fail if user already accepted invite', async () => {
|
||||
mailer.invite.mockImplementation(async () => ({ emailSent: true }));
|
||||
|
||||
const email = randomEmail();
|
||||
const payload = [{ email }];
|
||||
const response = await authOwnerAgent.post('/users').send(payload);
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
|
||||
const { data } = response.body;
|
||||
const invitedUserId = data[0].user.id;
|
||||
const reinviteResponse = await authOwnerAgent.post(`/users/${invitedUserId}/reinvite`);
|
||||
|
||||
expect(reinviteResponse.statusCode).toBe(200);
|
||||
|
||||
const member = await createMember();
|
||||
const reinviteMemberResponse = await authOwnerAgent.post(`/users/${member.id}/reinvite`);
|
||||
|
||||
expect(reinviteMemberResponse.statusCode).toBe(400);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user