Skip to content

Commit 91c9ff9

Browse files
committed
Adding .stop() sync test
1 parent 75c2f12 commit 91c9ff9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/animate/animate.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test.describe("animate() methods", () => {
3030
})
3131

3232
test("play with repeat: reverse", async ({ page }) => {
33-
await waitForAnimation("animate/animate-repeat-play.html", page)
33+
await waitForAnimation("animate/animate-repeat-play.html", page, 600)
3434
await eachBox(page, async (box) => {
3535
// Verify the box is at its original position
3636
const boundingBox = await box.boundingBox()
@@ -310,6 +310,14 @@ test.describe("animate() methods", () => {
310310
expect(style).toContain("transform: translateX")
311311
expect(await box.innerText()).toBe("finished")
312312
})
313+
314+
const boxes = page.locator(".box")
315+
const jsBox = boxes.nth(1)
316+
const waapiBox = boxes.nth(2)
317+
const jsX = Math.round((await jsBox.boundingBox())?.x || 100)
318+
const waapiX = Math.round((await waapiBox.boundingBox())?.x || 50)
319+
320+
expect(Math.abs(jsX - waapiX)).toBeLessThanOrEqual(2)
313321
})
314322

315323
test("stop() prevents animation from restarting with play()", async ({

0 commit comments

Comments
 (0)