From 5c524c2559c82d5955d3454c7dae7abeb40f1743 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 14 Jun 2025 07:28:03 +0200 Subject: [PATCH] Merge create and list guests into a single test --- tests/guests.spec.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/guests.spec.ts b/tests/guests.spec.ts index d7309a0..ccce687 100644 --- a/tests/guests.spec.ts +++ b/tests/guests.spec.ts @@ -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');