- 详情页路由入参统一为 stopId,废弃 targetType/targetId - ExplainDetailEntryRequest 与 GlobalAudioSource 移除 targetType/targetId 字段 - 播放器源匹配仅按 stopId 判定,移除 targetType 兜底 - 删除 explainDetailTarget 死代码 - 清理 guideStopInfoAdapter 中 stop/info、play-info、text-info 旧契约类型与转换函数 - 补充测试服务器 Nginx SSL 部署手册 - 同步更新单测与 e2e 用例 Made-with: Proma
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
toGuideStopInfo
|
||||
} from '@/data/adapters/guideStopInfoAdapter'
|
||||
import {
|
||||
canToggleGuideAudioGender,
|
||||
GUIDE_AUDIO_LANGUAGE_OPTIONS,
|
||||
@@ -46,36 +43,6 @@ const audioOptions: MuseumGuideAudioOption[] = [
|
||||
]
|
||||
|
||||
describe('guide audio options', () => {
|
||||
it('parses directly playable audio options from stop-info', () => {
|
||||
const stopInfo = toGuideStopInfo({
|
||||
available: true,
|
||||
targetType: 'STOP',
|
||||
targetId: '100',
|
||||
lang: 'zh-CN',
|
||||
title: '测试讲解',
|
||||
audioStatus: 'READY',
|
||||
audioOptionCount: 5,
|
||||
audioOptions: audioOptions.map((option) => ({
|
||||
...option,
|
||||
duration: 120
|
||||
}))
|
||||
}, {
|
||||
targetType: 'STOP',
|
||||
targetId: '100',
|
||||
lang: 'zh-CN'
|
||||
})
|
||||
|
||||
expect(stopInfo.audioOptions).toHaveLength(5)
|
||||
expect(stopInfo.audioOptions[1]).toMatchObject({
|
||||
channelCode: 'standard.zh-CN.male',
|
||||
languageCode: 'zh-CN',
|
||||
gender: 'male',
|
||||
playUrl: '/audio/zh-male.mp3',
|
||||
duration: 120
|
||||
})
|
||||
expect(stopInfo.supportedLanguages).toEqual(['zh-CN', 'en-US', 'yue-HK'])
|
||||
})
|
||||
|
||||
it('keeps tabs in Chinese, English, Cantonese order and defaults Chinese and English to male', () => {
|
||||
expect(GUIDE_AUDIO_LANGUAGE_OPTIONS.map((option) => option.value)).toEqual([
|
||||
'zh-CN',
|
||||
|
||||
Reference in New Issue
Block a user