Skip to content

Commit 72d6592

Browse files
committed
Simplify the test using getByText
1 parent 1ae3b7b commit 72d6592

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/e2e/community-events.spec.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,15 @@ test("community events page map loads and Zurich meetup link works", async ({
2828
await pastEventsSection.scrollIntoViewIfNeeded()
2929

3030
// Find the scrollview container with past events and meetups
31-
const meetupsList = page.locator('[class*="scrollview"]').first()
32-
await expect(meetupsList).toBeVisible()
33-
34-
// Scroll the meetups list to find Zurich
35-
await meetupsList.evaluate(el => {
36-
el.scrollLeft = el.scrollWidth
37-
})
3831

3932
// Find the Zurich meetup card in the scrollable list (not the map popup)
40-
const zurichLink = meetupsList.getByText("Zurich").first()
41-
await expect(zurichLink).toBeVisible()
42-
await zurichLink.scrollIntoViewIfNeeded()
43-
await zurichLink.click()
33+
const link = page.getByText(/Zurich/i).first()
34+
await link.scrollIntoViewIfNeeded()
35+
await link.click()
4436

4537
// Click the link and verify it opens to the correct URL
4638
const pagePromise = page.context().waitForEvent("page")
47-
await zurichLink.click()
39+
await link.click()
4840
const newPage = await pagePromise
4941

5042
await newPage.waitForLoadState("domcontentloaded", { timeout: 10000 })

0 commit comments

Comments
 (0)