讲解对象列表接入展厅分页接口
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-17 18:27:24 +08:00
parent 7267dfcac1
commit cf6ad02318
18 changed files with 682 additions and 409 deletions

View File

@@ -9,38 +9,30 @@ vi.mock('@/utils/hostEnvironment', () => ({
}))
describe('讲解展厅选择列表', () => {
it('业务单元卡片显示业务单元标签,并保留讲解数量和点击事件', async () => {
it('展厅卡片显示讲解对象数量,不暴露业务单元契约', async () => {
const wrapper = mount(ExplainHallSelect, {
props: {
stage: 'unit',
businessUnits: [
stage: 'hall',
halls: [
{
id: 'unit-evolution',
name: '生命演化',
hallId: 'hall-evolution',
guideStopCount: 6
},
{
id: 'unit-dinosaur',
name: '恐龙世界',
hallId: 'hall-dinosaur',
guideStopCount: 4
id: 'hall-evolution',
name: '生命演化',
explainCount: 6,
guideStopCount: 6,
searchText: '生命演化厅'
}
]
}
})
const cards = wrapper.findAll('.unit-card')
expect(cards).toHaveLength(2)
expect(wrapper.text()).toContain('生命演化')
expect(wrapper.text()).toContain('恐龙世界')
expect(wrapper.text()).toContain('6 个讲解')
expect(wrapper.text()).toContain('4 个讲解')
expect(cards.map((card) => card.text()).join('')).not.toContain('业务单元')
expect(cards[0]?.find('.floor-badge').exists()).toBe(false)
const cards = wrapper.findAll('.hall-card')
expect(cards).toHaveLength(1)
expect(wrapper.text()).toContain('生命演化')
expect(wrapper.text()).toContain('6 个讲解对象')
expect(wrapper.text()).not.toContain('业务单元')
await cards[0]?.trigger('tap')
expect(wrapper.emitted('businessUnitClick')).toEqual([['unit-evolution']])
expect(wrapper.emitted('hallClick')).toEqual([['hall-evolution']])
})
it('READY 讲解点不显示可讲解标签,非 READY 讲解点保留图文标签和点击事件', async () => {