同步 sgs-frontend-mobile 源码
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-27 11:26:01 +08:00
parent 575dca430f
commit 9ea1bfab71
181 changed files with 24395 additions and 5212 deletions

View File

@@ -35,36 +35,7 @@ describe('全局讲解播放器语言切换', () => {
vi.unstubAllGlobals()
})
it('详情页提供语言变体播放地址时直接切换,不请求 play-info', async () => {
await player.play({
id: 'mandarin-audio',
name: '测试讲解',
audioUrl: '/museum-assets/audio/mandarin.mp3',
language: 'zh-CN'
}, {
source: {
targetType: 'STOP',
targetId: '1823450596800289',
lang: 'zh-CN'
}
})
await expect(player.switchLanguage('yue-HK', {
id: 'cantonese-audio',
name: '测试讲解',
audioUrl: '/museum-assets/audio/cantonese.mp3',
language: 'yue-HK'
})).resolves.toBe(true)
expect(repositoryMocks.getPlayInfo).not.toHaveBeenCalled()
expect(player.currentSource.value?.lang).toBe('yue-HK')
expect(player.currentAudio.value).toEqual(expect.objectContaining({
language: 'yue-HK',
audioUrl: '/museum-assets/audio/cantonese.mp3'
}))
})
it('未提供详情语言变体时保留 play-info 刷新回退', async () => {
it('切换到粤语时立即中断旧音频,并使用 yue-HK 播放地址', async () => {
repositoryMocks.getPlayInfo.mockResolvedValue({
playable: true,
targetType: 'STOP',