修复H5导览与讲解状态闭环
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-19 17:07:40 +08:00
parent 97788a3e9f
commit 3cba97b786
12 changed files with 147 additions and 44 deletions

View File

@@ -501,7 +501,7 @@ describe('首页搜索与地图闭环', () => {
await viewHallAction.trigger('tap')
await flushPromises()
expect(vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url).toContain('/pages/hall/detail?id=hall-l2')
expect(vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url).toContain('/pages/explain/guide-stop-list?hallId=hall-l2')
await testState.onShowHandler?.()
await flushPromises()
expect(testState.resetToViewBaselineCalls).toHaveLength(0)
@@ -528,8 +528,8 @@ describe('首页搜索与地图闭环', () => {
expect(testState.resetToViewBaselineCalls).toHaveLength(1)
})
it('模型点选展厅的相关讲解进入展品详情,并在返回时复位原楼层', async () => {
testState.explainResults = [{ type: 'exhibit', exhibitId: 'exhibit-l2' }]
it('模型点选展厅的相关讲解进入该展厅的讲解对象列表,并在返回时复位原楼层', async () => {
testState.halls = [{ id: 'hall-l2', poiId: poi.id, name: '二层展厅' }]
const wrapper = await mountIndex()
const map = wrapper.getComponent(GuideMapShellStub)
@@ -546,7 +546,7 @@ describe('首页搜索与地图闭环', () => {
await relatedActions[1]!.trigger('tap')
await flushPromises()
expect(vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url).toContain('/pages/exhibit/detail?id=exhibit-l2')
expect(vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url).toContain('/pages/explain/guide-stop-list?hallId=hall-l2')
confirmLatestNavigation()
await testState.onShowHandler?.()
await flushPromises()
@@ -559,7 +559,7 @@ describe('首页搜索与地图闭环', () => {
expect(wrapper.find('.guide-poi-card').exists()).toBe(false)
})
it('模型点选展厅的相关讲解优先进入展厅详情并保留一次性返回上下文', async () => {
it('模型点选展厅的相关讲解优先进入讲解对象列表并保留一次性返回上下文', async () => {
testState.halls = [{ id: 'hall-l2', poiId: poi.id, name: '二层展厅' }]
const wrapper = await mountIndex()
const map = wrapper.getComponent(GuideMapShellStub)
@@ -574,7 +574,7 @@ describe('首页搜索与地图闭环', () => {
await wrapper.findAll('.poi-action')[1]!.trigger('tap')
await flushPromises()
expect(vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url).toContain('/pages/hall/detail?id=hall-l2')
expect(vi.mocked(uni.navigateTo).mock.calls[0]?.[0]?.url).toContain('/pages/explain/guide-stop-list?hallId=hall-l2')
confirmLatestNavigation()
await testState.onShowHandler?.()
await flushPromises()