From 5a2d20835b3f76feec8f0793eb69e1ec272146b1 Mon Sep 17 00:00:00 2001 From: augmentedmode Date: Wed, 16 Oct 2024 11:59:38 -0400 Subject: [PATCH] fix tests --- tests/defaults.spec.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/defaults.spec.ts b/tests/defaults.spec.ts index 0069431..ebe96c7 100644 --- a/tests/defaults.spec.ts +++ b/tests/defaults.spec.ts @@ -44,22 +44,19 @@ test('does nothing when the user tries to bypass the warning', async ({ await expect(page.isClosed()).toBe(false); }); -test('redirects when the user clicks "My Portfolio"', async ({ page }) => { +test('redirects when the user clicks "Back to safety"', async ({ page }) => { const querystring = new URLSearchParams({ href: 'https://test.com', }); await page.goto(`/#${querystring}`); - // Click the "My Portfolio" button - await page.getByRole('button', { name: 'My Portfolio' }).click(); + await page.getByRole('button', { name: 'Back to safety' }).click(); - // Increase the timeout to 60 seconds await page.waitForURL( 'https://portfolio.metamask.io/?metamaskEntry=phishing_page_portfolio_button&marketingEnabled=true', { timeout: 10000 }, ); - // Ensure the final URL matches the expected portfolio page await expect(page.url()).toBe( 'https://portfolio.metamask.io/?metamaskEntry=phishing_page_portfolio_button&marketingEnabled=true', );