修复导览位置预览与楼层状态
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-19 21:04:57 +08:00
parent 3cba97b786
commit 47dd4c7c87
9 changed files with 128 additions and 28 deletions

View File

@@ -385,7 +385,7 @@ describe('首页搜索与地图闭环', () => {
}
})
it('分类结果进入详情后恢复目标楼层标准视图', async () => {
it('分类结果进入详情后恢复目标楼层与搜索列表位置', async () => {
const wrapper = await mountIndex()
const search = wrapper.getComponent(PoiSearchPanelStub)
const map = wrapper.getComponent(GuideMapShellStub)
@@ -419,8 +419,8 @@ describe('首页搜索与地图闭环', () => {
await testState.onShowHandler?.()
await flushPromises()
expect(testState.searchResetCount).toBeGreaterThan(0)
expect(testState.searchRestoreCount).toBe(0)
expect(testState.searchResetCount).toBe(0)
expect(testState.searchRestoreCount).toBeGreaterThan(0)
expect(map.props('activeFloor')).toBe('L2')
expect(map.props('visiblePoiIds')).toBeNull()
expect(map.props('targetFocusRequest')).toBeNull()
@@ -431,7 +431,7 @@ describe('首页搜索与地图闭环', () => {
expect(testState.searchResetCount).toBe(resetCount)
})
it('全屏搜索结果进入详情并返回后同样恢复为默认收缩态', async () => {
it('全屏搜索结果进入详情并返回后保留搜索上下文', async () => {
const wrapper = await mountIndex()
const search = wrapper.getComponent(PoiSearchPanelStub)
const map = wrapper.getComponent(GuideMapShellStub)
@@ -447,8 +447,8 @@ describe('首页搜索与地图闭环', () => {
await testState.onShowHandler?.()
await flushPromises()
expect(testState.searchResetCount).toBeGreaterThan(0)
expect(testState.searchRestoreCount).toBe(0)
expect(testState.searchResetCount).toBe(0)
expect(testState.searchRestoreCount).toBeGreaterThan(0)
expect(map.props('visiblePoiIds')).toBeNull()
expect(map.props('targetFocusRequest')).toBeNull()
expect(map.props('activeFloor')).toBe('L2')

View File

@@ -32,4 +32,23 @@ describe('VisitorPoiPresentation', () => {
expect(result.get('p1')?.displayName).toBe('无障碍卫生间 · 1F · 恐龙厅 · 服务设施')
expect(result.get('p2')?.displayName).toBe('无障碍卫生间 · 2F · 生态厅 · 服务设施')
})
it('用稳定序号区分同楼层同区域的重名设施', () => {
const result = createVisitorPoiPresentations([
poi('p1', '无障碍卫生间', '1F', '恐龙厅'),
poi('p2', '无障碍卫生间', '1F', '恐龙厅')
])
expect(result.get('p1')?.displayName).toBe('无障碍卫生间 · 1F · 恐龙厅 · 服务设施')
expect(result.get('p2')?.displayName).toBe('无障碍卫生间 · 1F · 恐龙厅 · 服务设施 2')
})
it('省略与名称重复的展厅提示,保留最小位置上下文', () => {
const result = createVisitorPoiPresentations([
poi('p1', '球幕影院', '1F', '球幕影院')
])
expect(result.get('p1')?.displayName).toBe('球幕影院')
expect(result.get('p1')?.locationHint).toBe('1F · 服务设施')
})
})