feat: 重建 Sense 单路实时监看 (#68)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { playbackStatusDetail, playbackStatusLabel, playbackStatusType, routeStatus } from '@/views/sense/liveview/playbackStatus'
|
||||
|
||||
describe('Sense live-view playback states', () => {
|
||||
it('keeps authentication, missing stream and timeout actionable', () => {
|
||||
expect(playbackStatusLabel('authentication_failed')).toBe('摄像头认证失败')
|
||||
expect(playbackStatusDetail('stream_not_found')).toContain('视频服务')
|
||||
expect(playbackStatusDetail('timeout')).toContain('20 秒')
|
||||
expect(playbackStatusType('offline')).toBe('danger')
|
||||
})
|
||||
|
||||
it('maps route readiness without relying on color alone', () => {
|
||||
expect(routeStatus('ready')).toEqual({ label: '可观看', type: 'success' })
|
||||
expect(routeStatus('waiting')).toEqual({ label: '等待观看', type: 'warning' })
|
||||
expect(routeStatus('apply_failed').label).toBe('需要处理')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user