fix: 统一馆内三维模型返回初始状态
This commit is contained in:
@@ -143,10 +143,9 @@ afterEach(() => {
|
||||
})
|
||||
|
||||
describe('点位详情实际渲染与返回闭环', () => {
|
||||
it('解析目标楼层和点位后才挂载地图,避免默认楼层中间帧', async () => {
|
||||
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({
|
||||
@@ -163,7 +162,7 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('只展示真实详情字段,并向地图发送正确楼层与点位定位请求', async () => {
|
||||
it('只展示真实详情字段,并发送正确的位置预览请求', async () => {
|
||||
const wrapper = mountDetail()
|
||||
|
||||
await loadDetail({
|
||||
@@ -174,7 +173,6 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
})
|
||||
|
||||
const sheet = wrapper.get('[data-testid="facility-detail-sheet"]')
|
||||
const mapShell = wrapper.getComponent(GuideMapShellStub)
|
||||
expect(sheet.text()).toContain('二层卫生间')
|
||||
expect(sheet.text()).toContain('类别洗手间')
|
||||
expect(sheet.text()).toContain('楼层2F')
|
||||
@@ -182,10 +180,11 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
expect(sheet.text()).not.toContain('展示点位')
|
||||
expect(sheet.text()).not.toContain('已在对应楼层模型中标出点位')
|
||||
expect(wrapper.find('.detail-restore').exists()).toBe(false)
|
||||
const mapShell = wrapper.getComponent(GuideMapShellStub)
|
||||
expect(mapShell.props('activeFloor')).toBe('floor-l2')
|
||||
expect(mapShell.props('targetFocusRequest')).toMatchObject({
|
||||
poiId: 'poi-restroom-l2',
|
||||
floorId: 'floor-l2',
|
||||
poiId: facilityPoi.id,
|
||||
floorId: facilityPoi.floorId,
|
||||
positionGltf: [12, 3, -8]
|
||||
})
|
||||
})
|
||||
@@ -223,7 +222,7 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
expect(uni.reLaunch).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('搜索单结果关闭详情后回到首页', async () => {
|
||||
it('搜索单结果关闭详情同样仅使用页面栈返回', async () => {
|
||||
const wrapper = mountDetail()
|
||||
await loadDetail({
|
||||
source: 'search',
|
||||
@@ -234,8 +233,8 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
|
||||
await wrapper.get('[data-testid="facility-detail-close"]').trigger('tap')
|
||||
|
||||
expect(uni.reLaunch).toHaveBeenCalledWith({ url: '/pages/index/index' })
|
||||
expect(uni.navigateBack).not.toHaveBeenCalled()
|
||||
expect(uni.navigateBack).toHaveBeenCalledWith(expect.objectContaining({ delta: 1 }))
|
||||
expect(uni.reLaunch).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('直接进入详情时使用常规返回', async () => {
|
||||
@@ -248,11 +247,10 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
expect(uni.reLaunch).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('地图报告点位缺失或定位失败时显示面向用户的错误反馈', async () => {
|
||||
it('位置预览失败时显示面向用户的错误反馈', async () => {
|
||||
const wrapper = mountDetail()
|
||||
await loadDetail({ id: facilityPoi.id, target: facilityPoi.name })
|
||||
const mapShell = wrapper.getComponent(GuideMapShellStub)
|
||||
|
||||
mapShell.vm.$emit('target-focus', {
|
||||
requestId: 1,
|
||||
poiId: facilityPoi.id,
|
||||
@@ -260,18 +258,7 @@ describe('点位详情实际渲染与返回闭环', () => {
|
||||
status: 'missing'
|
||||
})
|
||||
await flushPromises()
|
||||
expect(wrapper.get('[data-testid="facility-location-error"]').text())
|
||||
.toContain('缺少可用的位置数据')
|
||||
|
||||
mapShell.vm.$emit('target-focus', {
|
||||
requestId: 1,
|
||||
poiId: facilityPoi.id,
|
||||
floorId: facilityPoi.floorId,
|
||||
status: 'error'
|
||||
})
|
||||
await flushPromises()
|
||||
expect(wrapper.get('[data-testid="facility-location-error"]').text())
|
||||
.toContain('地图定位暂不可用')
|
||||
expect(wrapper.get('[data-testid="facility-location-error"]').text()).toContain('缺少可用的位置数据')
|
||||
})
|
||||
|
||||
it('位置数据源加载失败时提供明确重试反馈', async () => {
|
||||
|
||||
Reference in New Issue
Block a user