This commit is contained in:
@@ -62,9 +62,11 @@ const GuidePageFrameStub = defineComponent({
|
||||
const GuideMapShellStub = defineComponent({
|
||||
name: 'GuideMapShell',
|
||||
props: {
|
||||
mapType: { type: String, default: 'indoor' }
|
||||
mapType: { type: String, default: 'indoor' },
|
||||
indoorView: { type: String, default: 'overview' },
|
||||
indoorRenderMode: { type: String, default: 'three-d' }
|
||||
},
|
||||
emits: ['initial-model-ready', 'initial-model-failed', 'mode-change'],
|
||||
emits: ['initial-model-ready', 'initial-model-failed', 'mode-change', 'indoor-render-mode-change'],
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
testState.threeMapMountCount += 1
|
||||
@@ -171,6 +173,27 @@ describe('首页启动遮罩与馆内模型生命周期', () => {
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
it('二维手动切换保留当前视图,底图兜底成功后同步实际模式', async () => {
|
||||
const wrapper = await mountIndex()
|
||||
const shell = wrapper.getComponent(GuideMapShellStub)
|
||||
|
||||
shell.vm.$emit('indoor-render-mode-change', 'two-d')
|
||||
await nextTick()
|
||||
expect(shell.props('indoorRenderMode')).toBe('two-d')
|
||||
expect(shell.props('indoorView')).toBe('overview')
|
||||
|
||||
shell.vm.$emit('indoor-render-mode-change', 'three-d')
|
||||
await nextTick()
|
||||
shell.vm.$emit('initial-model-failed', {
|
||||
...initialModelFailed,
|
||||
fallbackAvailable: true,
|
||||
actualRenderMode: 'two-d'
|
||||
})
|
||||
await nextTick()
|
||||
expect(shell.props('indoorRenderMode')).toBe('two-d')
|
||||
expect(shell.props('indoorView')).toBe('overview')
|
||||
})
|
||||
|
||||
it('仅在用户主动切换到馆外 2D 时才挂载 TencentMap', async () => {
|
||||
const wrapper = await mountIndex()
|
||||
const shell = wrapper.getComponent(GuideMapShellStub)
|
||||
|
||||
Reference in New Issue
Block a user