test: keep expired iso goldens explicit

Issue: #168
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-08-17 13:40:04 +03:00
parent 0040615a45
commit 141c657813
8 changed files with 40 additions and 22 deletions
File diff suppressed because one or more lines are too long
+9
View File
@@ -343,10 +343,19 @@ export async function prepareGoldenScenario(page, scenario) {
await card.updateComplete;
await settleMode(card);
}
if (scenario.testOnlyLabsSnapshot) {
if (!scenario.labs?.length || typeof card._onLabsSnapshot !== 'function') {
throw new Error(`invalid test-only Labs contract: ${scenario.id}`);
}
card._onLabsSnapshot({ active: Object.freeze([...scenario.labs]), space: '' });
await card.updateComplete;
await frame();
}
if (scenario.projection === 'iso' && typeof card._setProjection === 'function') {
card._setProjection('iso');
await card.updateComplete;
await frame();
await until(() => card._renderProjection === 'iso');
}
if (Number.isFinite(scenario.zoom)) {
card._applyView(scenario.zoom, 500, 500);
+15 -7
View File
@@ -6,6 +6,10 @@ export const GOLDEN_MATRIX_VERSION = 24;
const stage = { capture: 'stage', threshold: { maxChannelDelta: 10, maxDiffRatio: 0.0005 } };
const page = { capture: 'page', threshold: { maxChannelDelta: 10, maxDiffRatio: 0.0008 } };
const sunWindow = { capture: 'sun-window', threshold: { maxChannelDelta: 10, maxDiffRatio: 0.001 } };
// The product flag expires at 1.65.0 by contract. Golden keeps the dormant
// renderer covered through an explicit card-only snapshot; this never changes
// URL/storage/registry behaviour and must fail if the rendered view stays flat.
const expiredIsoFixture = { testOnlyLabsSnapshot: true };
export const GOLDEN_SCENARIOS = Object.freeze([
{ id: 'split-corner-wall-before-dark', fixture: 'visual', space: 'golden-corner-split',
@@ -16,20 +20,23 @@ export const GOLDEN_SCENARIOS = Object.freeze([
cornerSplitWall: 'thick', mode: 'view', theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'isometric-geometry-view-dark', fixture: 'visual', space: 'golden-geometry', mode: 'view',
// Stage 2 material/floor-edge plus door, window, gate and nested-room coverage.
labs: ['iso'], projection: 'iso', theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
labs: ['iso'], projection: 'iso', ...expiredIsoFixture,
theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'isometric-geometry-view-light', fixture: 'visual', space: 'golden-geometry', mode: 'view',
labs: ['iso'], projection: 'iso', theme: 'light', viewport: { width: 1000, height: 900 }, ...stage },
labs: ['iso'], projection: 'iso', ...expiredIsoFixture,
theme: 'light', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'isometric-live-layers-dark', fixture: 'visual', space: 'golden-lighting', mode: 'view',
labs: ['iso'], projection: 'iso', theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
labs: ['iso'], projection: 'iso', ...expiredIsoFixture,
theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'isometric-no-borders-dark', fixture: 'visual', space: 'golden-lighting', mode: 'view',
labs: ['iso'], projection: 'iso', showBorders: false, fillMode: 'custom',
labs: ['iso'], projection: 'iso', ...expiredIsoFixture, showBorders: false, fillMode: 'custom',
customFill: { c: '#486a8f', a: 0.42 }, glowEnabled: true,
theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'isometric-touch-kiosk-dark', fixture: 'visual', space: 'golden-geometry', mode: 'view',
labs: ['iso'], projection: 'iso', kiosk: true,
labs: ['iso'], projection: 'iso', ...expiredIsoFixture, kiosk: true,
theme: 'dark', viewport: { width: 390, height: 760 }, ...stage },
{ id: 'isometric-large-warm-remount-dark', fixture: 'large', space: 'perf-floor-2', mode: 'view',
labs: ['iso'], projection: 'iso', warmRemount: true,
labs: ['iso'], projection: 'iso', ...expiredIsoFixture, warmRemount: true,
theme: 'dark', viewport: { width: 1180, height: 900 }, ...stage },
{ id: 'geometry-view-dark-fit', fixture: 'visual', space: 'golden-geometry', mode: 'view',
theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
@@ -86,7 +93,8 @@ export const GOLDEN_SCENARIOS = Object.freeze([
theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'isometric-wall-junctions-dark', fixture: 'visual',
space: 'golden-wall-junctions', wallJunctions: true, mode: 'view',
labs: ['iso'], projection: 'iso', theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
labs: ['iso'], projection: 'iso', ...expiredIsoFixture,
theme: 'dark', viewport: { width: 1000, height: 900 }, ...stage },
{ id: 'opening-placement-door-thick-wall-dark', fixture: 'visual', space: 'golden-geometry',
// The shared centre edge is a long 25 cm physical wall. It can contain the
// complete 90 cm door preset while still proving rotation, inner-face
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 282 KiB

+12 -12
View File
@@ -1,7 +1,7 @@
{
"version": 1,
"fixture": "synthetic-only",
"sourceFingerprint": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceFingerprint": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"captureScriptSha256": "34f2219790d46efd8250e7a1bd829cb8fc0b0547e1260635fefa52407551b41b",
"command": "npm run build && node demo/docs/capture.mjs",
"scenarios": {
@@ -13,7 +13,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "d36b6f9f8139f31ef73a780c6511a640a26055efd9d7a24c24fd48b1d8379bf0"
},
"view-touch": {
@@ -24,7 +24,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "358e25ff9984d0fb0c03cfbb848df40c425fdfe64cd5f4f613b1e754ca9d4249"
},
"space-create": {
@@ -35,7 +35,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "c53db2e5c642a5549c13f3c93a5b359fed69bdb2621bf71a243a877ffcb95e6b"
},
"room-contour-close": {
@@ -46,7 +46,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "2f4770869f04c8d7f1e8ff33af1e8bd79f45ad6d97be6d5e6135b3a82fec9e4c"
},
"plan-context-tray": {
@@ -57,7 +57,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "47d8fc2ac1c14cb699e990ca9c00d89b9ac57f6cc76b40420ceb26b4d7f50df4"
},
"device-editor": {
@@ -68,7 +68,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "7c3e25534fc819c45431907616c3d523961505859ee68af27cce2daec9f04fb0"
},
"device-display-preview": {
@@ -79,8 +79,8 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"imageSha256": "df3a54395c83bffd7a161f1fb3de0143e12e76567535aedf9883873ead74df91"
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "f6014caed7b7d28790b8548996ba09d806a4e4d51fbb7e8d3fb3c582ebe49167"
},
"background-editor": {
"file": "07-background-editor.png",
@@ -90,7 +90,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "4e7b3b1220a3fe104cf11e5b32a31b343dc95c45fd2cbe3365d145f0a66a560d"
},
"room-card": {
@@ -101,7 +101,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "176abba71d41cfb045a33f82a794d9fbb2a5d3c48e6df66e6ec3a8e448311b11"
},
"device-info": {
@@ -112,7 +112,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "8fd93d5d22fc78ba77404f7255c0ebcf8de3633873cf276ef6e1e00dab6e625f",
"sourceSha256": "4511b35a5f77043991b669e0267533c3cdd9cdf060f792014a11fc82dbcd4f49",
"imageSha256": "2199ed88b215bf2bff63bf665028f78b2aa6a92c3032b803931790f2ef071893"
}
}
+1
View File
@@ -25,6 +25,7 @@ test('golden matrix has stable unique ids and bounded comparison thresholds', ()
assert.deepEqual(scenario.labs, ['iso'], scenario.id);
assert.equal(scenario.projection, 'iso', scenario.id);
assert.equal(scenario.mode, 'view', scenario.id);
assert.equal(scenario.testOnlyLabsSnapshot, true, scenario.id);
}
if (scenario.sunRayPixels) {
assert.equal(Number.isInteger(scenario.sunRayPixels.minPixels)