优化搜索点位详情页面切换体验
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-14 10:00:30 +08:00
parent abaeda189e
commit ef59570b0e
4 changed files with 95 additions and 51 deletions

View File

@@ -143,6 +143,26 @@ afterEach(() => {
})
describe('点位详情实际渲染与返回闭环', () => {
it('解析目标楼层和点位后才挂载地图,避免默认楼层中间帧', async () => {
const wrapper = mountDetail()
expect(wrapper.find('[data-testid="guide-map-shell"]').exists()).toBe(false)
expect(wrapper.get('[data-testid="facility-map-loading"]').text()).toContain('正在准备位置预览')
await loadDetail({
id: encodeURIComponent(facilityPoi.id),
target: encodeURIComponent(facilityPoi.name),
floorId: facilityPoi.floorId,
floorLabel: facilityPoi.floorLabel
})
expect(wrapper.getComponent(GuideMapShellStub).props('activeFloor')).toBe('floor-l2')
expect(wrapper.getComponent(GuideMapShellStub).props('targetFocusRequest')).toMatchObject({
poiId: facilityPoi.id,
floorId: facilityPoi.floorId
})
})
it('只展示真实详情字段,并向地图发送正确楼层与点位定位请求', async () => {
const wrapper = mountDetail()