Skip to content

Commit 2a4e271

Browse files
committed
fix failed test
1 parent 80114ec commit 2a4e271

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

e2e/navigation.spec.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,9 @@ test.describe("Navigation & Links", () => {
3737
for (const { name, expected } of footerLinks) {
3838
test(`Footer: Should open "${name}" link correctly`, async ({ page }) => {
3939
const link = page.getByRole("link", { name, exact: false });
40-
await expect(link).toBeVisible();
41-
42-
const popupPromise = page.waitForEvent("popup").catch(() => null);
43-
await link.click();
44-
45-
const popup = await popupPromise;
46-
const target: Page = popup || page;
47-
48-
await page.waitForTimeout(1000);
49-
50-
await expect(target).toHaveURL(new RegExp(expected));
40+
const popupPage = await openLinkAndReturnPage(page, link);
41+
await expect(popupPage).toHaveURL(new RegExp(expected));
42+
await popupPage.close();
5143
});
5244
}
5345

0 commit comments

Comments
 (0)