fix(video): refine transcript viewing and generation

This commit is contained in:
yiling
2026-12-03 16:00:41 +08:00
parent 5daa2a8f92
commit 543862ff9b
8 changed files with 67 additions and 25 deletions
@@ -7,6 +7,7 @@ test('reads, searches and follows a saved transcript in the video player', async
prisma,
}) => {
const { page, projectId, fileId } = file
await page.setViewportSize({ width: 1280, height: 720 })
await expect
.poll(() =>
prisma.asset.findUnique({
@@ -58,8 +59,12 @@ test('reads, searches and follows a saved transcript in the video player', async
const video = page.locator('video').first()
const sync = panel.getByRole('button', { name: 'Sync to playback' })
await expect(navigator).toBeHidden()
await expect(panel).toHaveCSS('width', '384px')
await expect(toggle).toHaveAttribute('aria-expanded', 'true')
await expect(toggle).toHaveCSS('cursor', 'pointer')
await expect(first).toHaveAttribute('aria-current', 'true')
await expect(first.getByText('Signal. signal.', { exact: true })).toHaveCSS('font-weight', '700')
await expect(first).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(first).toContainText('00:00.000 – 00:00.180')
await panel.getByRole('button', { name: 'Search transcript' }).click()
@@ -67,6 +72,9 @@ test('reads, searches and follows a saved transcript in the video player', async
await expect(search).toBeFocused()
await search.fill('SIGNAL.')
await expect(panel.getByText('1 / 3')).toBeVisible()
const match = panel.locator('[data-current-match]')
await expect(match).toHaveCSS('padding-left', '1px')
await expect(match).toHaveCSS('padding-right', '1px')
await panel.getByRole('button', { name: 'Next match' }).click()
await expect(panel.getByText('2 / 3')).toBeVisible()
await search.press('Enter')