修复楼层切换后无法返回建筑外观
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-13 19:51:58 +08:00
parent e48a8bb626
commit f2ee41fe44
2 changed files with 36 additions and 0 deletions

View File

@@ -168,6 +168,21 @@ const showOverview = async (page: Page, testInfo: TestInfo, name: string) => {
assertStableTransition(before, after)
}
const exitOverviewWithZoomControl = async (page: Page, testInfo: TestInfo, name: string) => {
const before = await getReport(page)
await screenshot(page, testInfo, `${name}-before`)
await page.getByText('', { exact: true }).click()
await expect.poll(async () => (await getReport(page)).activeView, { timeout: 10_000 }).toBe('overview')
const after = await getReport(page)
await screenshot(page, testInfo, `${name}-after`)
expect(after.isCameraTweening).toBe(false)
expect(after.modelRoot, 'the overview model must stay committed').not.toBeNull()
expect(after.modelRoot!.maxError).toBeLessThan(1e-12)
expect(after.camera.distance).toBeGreaterThanOrEqual(before.camera.distance * 1.2)
}
const normalizeFloorKey = (value: string) => value.trim().toLowerCase().replace(/[^a-z0-9.-]/g, '')
const resolveRequiredFloorId = (floors: FloorReport[], requested: string) => {
@@ -213,4 +228,8 @@ test('ordinary exterior and floor switches preserve the GLB_METER camera project
await switchFloor(page, testInfo, l1Point5, 'exterior-l1point5')
await showOverview(page, testInfo, 'l1point5-exterior')
await switchFloor(page, testInfo, l1, 'exterior-l1-auto-exit')
await switchFloor(page, testInfo, l2, 'l1-l2-auto-exit')
await exitOverviewWithZoomControl(page, testInfo, 'l2-exterior-auto-exit')
})