Skip to content

Commit adf8c7c

Browse files
committed
Do not use .poll on CI
1 parent 8001f6d commit adf8c7c

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

test/e2e/community-events.spec.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ test("map matches screenshot", async ({ page }) => {
2929

3030
const mapCanvas = page.locator("canvas").first()
3131

32-
await expect
33-
.poll(
34-
async () => {
35-
const box = await mapCanvas.boundingBox()
36-
return box && box.width > 100 && box.height > 100
37-
},
38-
{ timeout: 15_000 },
39-
)
40-
.toBe(true)
32+
if (!process.env.CI) {
33+
await expect
34+
.poll(
35+
async () => {
36+
const box = await mapCanvas.boundingBox()
37+
return box && box.width > 100 && box.height > 100
38+
},
39+
{ timeout: 15_000 },
40+
)
41+
.toBe(true)
42+
}
4143

4244
await expect(mapContainer.locator("canvas").first()).toHaveScreenshot(
4345
"meetups-map.png",
@@ -51,12 +53,16 @@ test("map tooltip appears on marker hover", async ({ page }) => {
5153
const mapContainer = page.locator("#meetups-map").first()
5254
await mapContainer.scrollIntoViewIfNeeded()
5355
await expect(mapContainer).toBeVisible({ timeout: 10000 })
54-
await expect
55-
.poll(async () => {
56-
const box = await mapContainer.boundingBox()
57-
return Boolean(box && box.width > 100 && box.height > 100)
58-
})
59-
.toBe(true)
56+
57+
if (!process.env.CI) {
58+
await expect
59+
.poll(async () => {
60+
const box = await mapContainer.boundingBox()
61+
return Boolean(box && box.width > 100 && box.height > 100)
62+
})
63+
.toBe(true)
64+
}
65+
6066
const tooltip = page.getByRole("tooltip")
6167
await expect(tooltip).toHaveCount(0)
6268
const mapCanvas = mapContainer.locator("canvas").first()

0 commit comments

Comments
 (0)