Merge create and list guests into a single test

This commit is contained in:
Manuel Bustillo 2025-06-14 07:28:03 +02:00
parent ae5a986f25
commit 5c524c2559

View File

@ -81,8 +81,10 @@ const mockGroupsAPI = ({ page }: { page: Page }) => {
})
}
test('should display the list of guests', async ({ page }) => {
test('should allow CRUD on guests', async ({ page }) => {
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
@ -105,14 +107,7 @@ test('should display the list of guests', async ({ page }) => {
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Work' })).toBeVisible();
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Invited' })).toBeVisible();
await expect(page.getByRole('row').nth(2).locator('svg')).toHaveCount(2);
});
test('should allow creating a new guest', async ({ page }) => {
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
await page.getByRole('button', { name: 'Add new' }).click();
await page.getByRole('dialog').getByLabel('Name').fill('John Snow');