This commit is contained in:
@@ -8,6 +8,14 @@ import GuideMapShell from '@/components/navigation/GuideMapShell.vue'
|
||||
const ThreeMapStub = defineComponent({
|
||||
name: 'ThreeMap',
|
||||
props: {
|
||||
initialFloorId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
initialView: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
visiblePoiIds: {
|
||||
type: Array,
|
||||
default: null
|
||||
@@ -71,4 +79,29 @@ describe('GuideMapShell 点位过滤契约', () => {
|
||||
expect(wrapper.emitted('floorChange')).toEqual([['L2']])
|
||||
expect(wrapper.emitted('targetFocus')).toEqual([[focusResult]])
|
||||
})
|
||||
|
||||
it('动态楼层业务视图不会覆盖首次外观模型初始化视图', () => {
|
||||
const wrapper = mount(GuideMapShell, {
|
||||
props: {
|
||||
mapType: 'indoor',
|
||||
indoorModelSource: modelSource,
|
||||
floors: [
|
||||
{ id: 'L1', label: '1F' },
|
||||
{ id: 'L2', label: '2F' }
|
||||
],
|
||||
activeFloor: 'L2',
|
||||
indoorView: 'floor',
|
||||
indoorInitialView: 'overview'
|
||||
},
|
||||
global: {
|
||||
stubs: {
|
||||
ThreeMap: ThreeMapStub
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const renderer = wrapper.getComponent(ThreeMapStub)
|
||||
expect(renderer.props('initialFloorId')).toBe('L2')
|
||||
expect(renderer.props('initialView')).toBe('overview')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user