This commit is contained in:
@@ -202,7 +202,7 @@ describe('首页搜索与地图闭环', () => {
|
||||
expect(map.props('visiblePoiIds')).toEqual(categoryContext.visiblePoiIds)
|
||||
})
|
||||
|
||||
it('分类结果进入详情并返回后收起搜索、清空 marker,但保留目标焦点与楼层', async () => {
|
||||
it('分类结果进入详情时不触发首页地图,返回后才恢复目标焦点与楼层', async () => {
|
||||
const wrapper = await mountIndex()
|
||||
const search = wrapper.getComponent(PoiSearchPanelStub)
|
||||
const map = wrapper.getComponent(GuideMapShellStub)
|
||||
@@ -215,13 +215,7 @@ describe('首页搜索与地图闭环', () => {
|
||||
search.vm.$emit('result-tap', poi, categoryContext)
|
||||
await flushPromises()
|
||||
|
||||
expect(map.props('activeFloor')).toBe('L2')
|
||||
expect(map.props('targetFocusRequest')).toMatchObject({
|
||||
poiId: poi.id,
|
||||
floorId: 'L2',
|
||||
floorLabel: '2F',
|
||||
positionGltf: poi.positionGltf
|
||||
})
|
||||
expect(map.props('targetFocusRequest')).toBeNull()
|
||||
|
||||
const navigateTo = vi.mocked(uni.navigateTo)
|
||||
const detailUrl = navigateTo.mock.calls[0]?.[0]?.url as string
|
||||
@@ -298,7 +292,7 @@ describe('首页搜索与地图闭环', () => {
|
||||
expect(testState.searchCollapseAfterDetailCount).toBe(0)
|
||||
expect(testState.searchRestoreCount).toBe(1)
|
||||
expect(map.props('visiblePoiIds')).toEqual(categoryContext.visiblePoiIds)
|
||||
expect(map.props('targetFocusRequest')).toMatchObject({ poiId: poi.id })
|
||||
expect(map.props('targetFocusRequest')).toBeNull()
|
||||
})
|
||||
|
||||
it('地图点位卡隐藏首页 dock 时仍保留搜索组件,关闭后可继续使用原列表', async () => {
|
||||
@@ -342,7 +336,7 @@ describe('首页搜索与地图闭环', () => {
|
||||
|
||||
const detailUrl = vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url as string
|
||||
expect(new URLSearchParams(detailUrl.split('?')[1]).get('resultCount')).toBe('1')
|
||||
expect(map.props('targetFocusRequest')).not.toBeNull()
|
||||
expect(map.props('targetFocusRequest')).toBeNull()
|
||||
|
||||
search.vm.$emit('cancel')
|
||||
await wrapper.vm.$nextTick()
|
||||
|
||||
Reference in New Issue
Block a user