修复粤语音频重复提示
This commit is contained in:
@@ -106,9 +106,6 @@
|
||||
</text>
|
||||
</template>
|
||||
<text v-if="currentDetailTextLoading" class="section-hint">{{ detailLoadingMessage }}</text>
|
||||
<text v-else-if="audioAvailabilityMessage" class="section-hint audio-status-hint">
|
||||
{{ audioAvailabilityMessage }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
@@ -144,4 +144,26 @@ describe('讲解详情音频优先布局', () => {
|
||||
language: 'en-US'
|
||||
}), expect.objectContaining({ displayMode: 'mini' }))
|
||||
})
|
||||
|
||||
it('音频不可用时只在音频控制区显示一次提示', async () => {
|
||||
mocks.enterExplainDetail.mockResolvedValue({
|
||||
...exhibit,
|
||||
audioUrl: undefined,
|
||||
audioDuration: undefined,
|
||||
audioStatus: 'MISSING',
|
||||
audioLanguage: 'yue-HK',
|
||||
audioUnavailableReason: '当前语言暂无语音讲解。'
|
||||
})
|
||||
|
||||
const wrapper = mount(ExhibitDetail, {
|
||||
global: { stubs: { GuidePageFrame: GuidePageFrameStub } }
|
||||
})
|
||||
|
||||
await mocks.onLoadHandler?.({ id: exhibit.id, lang: 'yue-HK', targetType: 'STOP', targetId: 'stop-1' })
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.find('.detail-audio-unavailable').text()).toBe('当前语言暂无语音讲解。')
|
||||
expect(wrapper.find('.audio-status-hint').exists()).toBe(false)
|
||||
expect(wrapper.findAll('.section-hint')).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user