🐛(backend) manage invitation partial update without email

An invitation can be updated to change its role. The front use a PATCH
sending only the changed role, so the email is missing in the
InivtationSerializer.validate method. We have to check first if an email
is present before working on it.
This commit is contained in:
Manuel Raynaud
2025-10-16 17:26:02 +02:00
committed by GitHub
parent 5908afb098
commit c048b2ae95
4 changed files with 45 additions and 1 deletions

View File

@@ -202,9 +202,19 @@ test.describe('Document create member', () => {
);
await expect(userInvitation).toBeVisible();
const responsePromisePatchInvitation = page.waitForResponse(
(response) =>
response.url().includes('/invitations/') &&
response.status() === 200 &&
response.request().method() === 'PATCH',
);
await userInvitation.getByLabel('doc-role-dropdown').click();
await page.getByRole('menuitem', { name: 'Reader' }).click();
const responsePatchInvitation = await responsePromisePatchInvitation;
expect(responsePatchInvitation.ok()).toBeTruthy();
const moreActions = userInvitation.getByRole('button', {
name: 'Open invitation actions menu',
});