🚸(app-desk) cannot select user or email already selected

- Add the teamid to the useUsers query, to not get
  the users that are already in the team
- Add a check to not select a user or email
  that is already selected
This commit is contained in:
Anthony LC
2024-03-29 11:19:12 +01:00
committed by Anthony LC
parent 591045b0ec
commit df15b41a87
4 changed files with 36 additions and 22 deletions

View File

@@ -176,14 +176,9 @@ test.describe('Members Create', () => {
await page.getByLabel('Add members to the team').click();
await inputSearch.fill('test');
await page.getByRole('option', { name: users[0].name }).click();
await page.getByRole('radio', { name: 'Owner' }).click();
await page.getByRole('button', { name: 'Validate' }).click();
await expect(
page.getByText(`Failed to add ${users[0].name} in the team`),
).toBeVisible();
page.getByRole('option', { name: users[0].name }),
).toBeHidden();
});
test('it try to add twice the same invitation', async ({
@@ -218,12 +213,6 @@ test.describe('Members Create', () => {
await page.getByLabel('Add members to the team').click();
await inputSearch.fill(email);
await page.getByRole('option', { name: email }).click();
await page.getByRole('button', { name: 'Validate' }).click();
await expect(
page.getByText(`Failed to create the invitation for ${email}`),
).toBeVisible();
await expect(page.getByRole('option', { name: email })).toBeHidden();
});
});