This commit is contained in:
@@ -67,7 +67,7 @@ describe('讲解展厅选择列表', () => {
|
||||
expect(wrapper.emitted('hallClick')).toEqual([['hall-evolution']])
|
||||
})
|
||||
|
||||
it('展厅阶段按主题色卡展示展厅名称和图标', () => {
|
||||
it('展厅阶段使用完整展厅卡片资源', () => {
|
||||
const wrapper = mount(ExplainHallSelect, {
|
||||
props: {
|
||||
stage: 'hall',
|
||||
@@ -85,12 +85,35 @@ describe('讲解展厅选择列表', () => {
|
||||
const card = wrapper.get('.hall-overview-card')
|
||||
expect(wrapper.get('.header-title').text()).toBe('免费讲解')
|
||||
expect(card.attributes('style')).toContain('--hall-card-color: #d9b06c')
|
||||
expect(card.text()).toContain('恐龙厅')
|
||||
expect(card.text()).not.toContain('Dinosaur Hall')
|
||||
expect(card.text()).not.toContain('35 个讲解对象')
|
||||
expect(card.get('.hall-full-card-image').attributes('src'))
|
||||
.toBe('/static/icons/halls/custom-cards/dinosaur.png')
|
||||
expect(card.find('.hall-overview-copy').exists()).toBe(false)
|
||||
expect(card.find('.hall-go-entry').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('讲解单元阶段显示单元目录并返回被选择的单元 ID', async () => {
|
||||
const wrapper = mount(ExplainHallSelect, {
|
||||
props: {
|
||||
stage: 'unit',
|
||||
selectedHallName: '生命演化厅',
|
||||
businessUnits: [{
|
||||
id: 'unit-origin',
|
||||
name: '生命起源',
|
||||
hallId: 'hall-evolution',
|
||||
guideStopCount: 6
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
||||
const card = wrapper.get('.business-unit-card')
|
||||
expect(wrapper.get('.header-title').text()).toBe('生命演化厅')
|
||||
expect(card.text()).toContain('生命起源')
|
||||
expect(card.text()).toContain('6 个讲解点')
|
||||
|
||||
await card.trigger('tap')
|
||||
expect(wrapper.emitted('businessUnitClick')).toEqual([['unit-origin']])
|
||||
})
|
||||
|
||||
it('READY 讲解点不显示可讲解标签,非 READY 讲解点保留图文标签和点击事件', async () => {
|
||||
const readyStop = {
|
||||
id: 'stop-ready',
|
||||
|
||||
Reference in New Issue
Block a user