mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 14:34:40 +00:00
fix(video): preserve transcript seek timestamps
This commit is contained in:
@@ -32,6 +32,7 @@ test('reads, searches and follows a saved transcript in the video player', async
|
||||
text: `Intervening segment ${index + 1}`,
|
||||
})),
|
||||
{ position: 29, startMs: 720, endMs: 980, text: 'Final signal.' },
|
||||
{ position: 30, startMs: 995, endMs: 1000, text: 'Closing word.' },
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -122,6 +123,19 @@ test('reads, searches and follows a saved transcript in the video player', async
|
||||
await expect(last).toHaveAttribute('aria-current', 'true')
|
||||
await expect(video).toHaveJSProperty('paused', true)
|
||||
|
||||
const closingWord = panel.getByRole('button', { name: /Closing word\./ })
|
||||
await closingWord.click()
|
||||
await expect
|
||||
.poll(() =>
|
||||
video.evaluate((element) => {
|
||||
const media = element as HTMLVideoElement
|
||||
return { seeking: media.seeking, timeMs: Math.round(media.currentTime * 1000) }
|
||||
}),
|
||||
)
|
||||
.toEqual({ seeking: false, timeMs: 995 })
|
||||
await expect(closingWord).toHaveAttribute('aria-current', 'true')
|
||||
await expect(video).toHaveJSProperty('paused', true)
|
||||
|
||||
await panel.getByRole('combobox', { name: 'Language' }).selectOption('zh')
|
||||
await expect(panel.getByText('你好。')).toBeVisible()
|
||||
await expect(last).toHaveCount(0)
|
||||
|
||||
Reference in New Issue
Block a user