mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
test(e2e): verify transcript scroll interruption by position
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user