mirror of
https://github.com/truewhile/MeBox.git
synced 2026-11-16 12:54:22 +08:00
优化
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { shouldShowPlayerDiagnostics } from './playerPageModel.ts'
|
||||
|
||||
function check(name: string, actual: boolean, expected: boolean) {
|
||||
if (actual !== expected) throw new Error(`playerDiagnostics: ${name}`)
|
||||
}
|
||||
|
||||
check('hidden by default and during normal playback', shouldShowPlayerDiagnostics('', ''), false)
|
||||
check('visible when playback fails', shouldShowPlayerDiagnostics('视频播放失败', ''), true)
|
||||
check('visible when media cannot be loaded', shouldShowPlayerDiagnostics('', '无法加载该媒体'), true)
|
||||
check('visible when both loading and playback fail', shouldShowPlayerDiagnostics('视频播放失败', '无法加载该媒体'), true)
|
||||
check('hidden again after errors are cleared', shouldShowPlayerDiagnostics('', ''), false)
|
||||
|
||||
console.log('playerDiagnostics.test.ts ok')
|
||||
Reference in New Issue
Block a user