test(e2e): verify transcript scroll interruption by position

This commit is contained in:
yiling
2026-12-04 23:49:02 +08:00
parent cfda8e9a0e
commit c0964c4921
@@ -201,18 +201,21 @@ test('reads, searches and follows a saved transcript in the video player', async
element.addEventListener(
'scroll',
() => {
element.setAttribute('data-test-interrupted-scroll-top', String(element.scrollTop))
element.dispatchEvent(new WheelEvent('wheel', { bubbles: true, deltaY: -120 }))
element.setAttribute('data-test-follow-interrupted', 'true')
},
{ once: true },
)
})
await sync.click()
await expect(viewport).toHaveAttribute('data-test-follow-interrupted', 'true')
await expect(viewport).toHaveAttribute('data-test-interrupted-scroll-top', /^\d/)
await expect(sync).toBeVisible()
await expect(last).not.toBeInViewport()
const interruptedScrollTop = Number(
await viewport.getAttribute('data-test-interrupted-scroll-top'),
)
await expect(viewport).toHaveJSProperty('scrollTop', interruptedScrollTop)
await sync.click()
await expect(last).toBeInViewport()
await expect(last).toBeInViewport({ ratio: 0.95 })
await expect(sync).toBeHidden()
await video.evaluate((element) => {