同步 sgs-frontend-mobile 源码
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-27 11:26:01 +08:00
parent 575dca430f
commit 9ea1bfab71
181 changed files with 24395 additions and 5212 deletions

View File

@@ -0,0 +1,52 @@
// @vitest-environment happy-dom
import { describe, expect, it } from 'vitest'
import { mount } from '@vue/test-utils'
import RoutePlannerPanel from '@/components/navigation/RoutePlannerPanel.vue'
const point = (name: string, floorLabel: string) => ({
poiId: name,
name,
floorId: floorLabel,
floorLabel,
positionGltf: [0, 0, 0] as [number, number, number]
})
describe('RoutePlannerPanel', () => {
it('在导航副标题中显示起点和终点楼层', () => {
const wrapper = mount(RoutePlannerPanel, {
props: {
startPoint: point('办公室', '5F'),
endPoint: point('秦匠', 'B2'),
hasRoutePreview: true,
summary: '跨 2 层 · 约 104 米'
}
})
expect(wrapper.get('.route-panel-subtitle').text()).toBe('从 5F 办公室 前往 B2 秦匠')
})
it('导航信息不显示点位内部楼层和设备编号', () => {
const previewWrapper = mount(RoutePlannerPanel, {
props: {
startPoint: point('L1_K电梯', '1F'),
endPoint: point('L2_导览屏_02', '2F'),
hasRoutePreview: true,
summary: '跨 1 层'
}
})
expect(previewWrapper.get('.route-panel-subtitle').text()).toBe('从 1F 电梯 前往 2F 导览屏')
const pickerWrapper = mount(RoutePlannerPanel, {
props: {
startPoint: point('L1_K电梯', '1F'),
endPoint: point('L2_导览屏_02', '2F'),
hasRoutePreview: false,
summary: ''
}
})
expect(pickerWrapper.get('.route-point-name').text()).toBe('电梯')
})
})