From 9543c7c77dda77ef28b65d2741be5f7d161be852 Mon Sep 17 00:00:00 2001 From: Sem Bauke Date: Mon, 9 Dec 2024 15:14:32 +0100 Subject: [PATCH] test: fix portfolio spec by introducing toPass with intervals (#57428) Co-authored-by: Oliver Eyton-Williams --- e2e/portfolio.spec.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/e2e/portfolio.spec.ts b/e2e/portfolio.spec.ts index 631daba3f77..965adc42790 100644 --- a/e2e/portfolio.spec.ts +++ b/e2e/portfolio.spec.ts @@ -24,9 +24,15 @@ test.describe('Add Portfolio Item', () => { await page.getByRole('button', { name: 'Edit my profile' }).click(); - await page - .getByRole('button', { name: 'Add a new portfolio Item' }) - .click(); + // Will check if the portfolio button is hydrated correctly with different intervals. + await expect(async () => { + const addPortfolioItemButton = page.getByRole('button', { + name: 'Add a new portfolio Item' + }); + await addPortfolioItemButton.click(); + + await expect(addPortfolioItemButton).toBeDisabled({ timeout: 1 }); + }).toPass(); }); test('The title has validation', async ({ page }) => {