From 9f54cbab7591ffba17ad3999bedeb70eba685aa9 Mon Sep 17 00:00:00 2001 From: Matysh Date: Tue, 25 Aug 2026 14:48:29 +0300 Subject: [PATCH] test: cover nested import lineage in browser Issue: #265 User-Visible: no --- demo/smoke_orphan_space_references.mjs | 12 +++++++++++- scripts/smoke-links.mjs | 5 +++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/demo/smoke_orphan_space_references.mjs b/demo/smoke_orphan_space_references.mjs index d83d1a8e..e11c0252 100644 --- a/demo/smoke_orphan_space_references.mjs +++ b/demo/smoke_orphan_space_references.mjs @@ -15,7 +15,8 @@ const out = await page.evaluate(async () => { }, { // Keep `home` non-final so this fixture proves the normal blocker; the // final-space safe-detach exception is covered by #113's lifecycle smoke. - id: 'other', title: 'Other', view_box: [0, 0, 1, 1], cell_cm: 5, rooms: [], + id: 'space_space_other_deadbeef_cafebabe', title: 'Other', + view_box: [0, 0, 1, 1], cell_cm: 5, rooms: [], }], markers: [ { @@ -28,6 +29,10 @@ const out = await page.evaluate(async () => { id: 'home-blocker', binding: 'virtual', space: 'home', name: 'Home blocker', }, { id: 'removed-marker', binding: 'virtual', removed: true, space: 'gone', name: 'Old marker' }, + { + id: 'lineage-marker', binding: 'virtual', + space: 'space_other_11111111', name: 'Nested lineage marker', + }, ], settings: { known_devices: ['removed-auto-device'] }, }; @@ -38,6 +43,7 @@ const out = await page.evaluate(async () => { 'removed-marker': { s: 'gone', x: 0.3, y: 0.4 }, 'removed-auto-device': { s: 'gone', x: 0.4, y: 0.5 }, 'lg_light.removed_group': { s: 'gone', x: 0.5, y: 0.6 }, + 'lineage-marker': { s: 'space_other_11111111', x: 0.7, y: 0.8 }, }; let serverConfig = clone(original); let serverLayout = clone(originalLayout); @@ -114,6 +120,10 @@ const out = await page.evaluate(async () => { && preview.layout['removed-marker'] === undefined && preview.layout['removed-auto-device'] === undefined && preview.layout['lg_light.removed_group'] === undefined; + const lineageMarker = preview?.config.markers.find((marker) => marker.id === 'lineage-marker'); + result.nestedImportLineageRepairsToOneCanonicalOwner = lineageMarker?.space + === 'space_space_other_deadbeef_cafebabe' + && preview.layout['lineage-marker']?.s === 'space_space_other_deadbeef_cafebabe'; const details = previewBody?.querySelector('details.optimize-details'); result.idsExistOnlyInClosedDetails = details && details.open === false && details.textContent.includes('opaque_owner') && details.textContent.includes('gone'); diff --git a/scripts/smoke-links.mjs b/scripts/smoke-links.mjs index 64b69144..acbf01c9 100644 --- a/scripts/smoke-links.mjs +++ b/scripts/smoke-links.mjs @@ -160,11 +160,12 @@ export const SMOKE_LINKS = [ symbols: [ 'repairSpaceReferences', 'collectSpaceMarkerDependencies', 'createSpaceDeletionCandidate', 'invalidDefaultFloor', + 'ImportLineageRoot', 'canonicalImportRoot', 'reversibleStem', 'addCandidate', ], smokes: ['smoke_orphan_space_references.mjs'], because: 'the production-bundle smoke proves the Optimize candidate, live marker rebuild, ' - + 'delete blocker and card-editor warning, while those UI surfaces do not expose the ' - + 'pure helper names at runtime', + + 'nested import-lineage collapse, delete blocker and card-editor warning, while those UI ' + + 'surfaces do not expose the pure helper names at runtime', }, { // #242: pure placement is called inside shared SVG/Iso renderers, while