Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AugmentedMode committed Oct 16, 2024
1 parent 2ace047 commit 5a2d208
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/defaults.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
Expand Down

0 comments on commit 5a2d208

Please sign in to comment.