修复馆内模型初始视图与点位返回复位
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-15 18:20:18 +08:00
parent 1072b25c46
commit 6566d38cb0
11 changed files with 568 additions and 44 deletions

View File

@@ -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')
})
})