Files
houseplan-card/test/paper-scene-contract.test.mjs
T
Claude 87195c2b5d test(daycycle): #582/#544 witnesses follow the bounded, hint-free layers
smoke_live_pan_coverage now expects an exposed scene to open only within
clip-path: inset(-25%) and the clip-marked day-cycle outline never to open;
idle scenes keep no clip-path. paper-scene-contract pins the opacity hint.

The Release trailer asks the branch's push Validate for the heavy jobs
(smokes, golden, performance): #689 moves golden frames and must be proven
by the full smoke set before S7 (#690).

Release: v1.78.0-beta.9
Issue: #689
User-Visible: no
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd
2026-09-28 17:51:06 +03:00

42 lines
2.4 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const source = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
test('#582 camera movement switches the day-cycle shadow to a stage-bounded scene', () => {
const helper = source('src/render/paper-scene.ts');
const card = source('src/houseplan-card.ts');
const staticRender = source('src/space-render.ts');
const styles = source('src/styles/plan.styles.ts');
assert.match(helper, /function renderPaperShapes/);
assert.match(helper, /pointer-events="none"/);
assert.match(card, /dayCycle && paperShapes\.length \? svg`<svg class="hp-paper-outline-svg"/);
assert.match(card, /data-hp-live-viewbox=\$\{iso \? 'camera' : 'floor'\}/);
assert.match(card, /renderPaperShapes\(paperShapes\)/);
assert.match(staticRender, /renderPaperShapes\(paperShapes\)/);
assert.match(staticRender, /dayCycle && paperShapes\.length \? svg`<svg class="hp-paper-outline-svg"/);
assert.match(card, /private _activateSafeDayCycleOutline\(\)/);
assert.match(card, /hp-safe-daycycle-outline/);
assert.match(card, /private _startCameraTransition\([\s\S]*?this\._activateSafeDayCycleOutline\(\);[\s\S]*?this\._cameraTransition\.start/);
assert.match(styles, /\.stage\.daycycle \.hp-paperg/);
assert.match(styles, /\.stage\.daycycle\.hp-safe-daycycle-outline \.hp-paper-outline-svg/);
assert.match(styles, /\.stage\.daycycle\.hp-safe-daycycle-outline \.hp-paperg \{[\s\S]*?filter:\s*none;[\s\S]*?will-change:\s*auto;/);
});
test('#582 safe camera scene uses explicit bounded plan and outline layers', () => {
const card = source('src/houseplan-card.ts');
const styles = source('src/styles/plan.styles.ts');
const staticCard = source('src/space-card.ts');
assert.match(card, /<svg class="plan-svg"/);
assert.match(styles, /\.plan-svg \{ z-index: 1; \}/);
assert.match(styles, /\.hp-paper-outline-svg \{[\s\S]*?z-index: 0;/);
// #689: explicit through the opacity hint; a transform hint froze the raster.
assert.match(styles, /\.stage\.daycycle\.hp-safe-daycycle-outline \.plan-svg \{[\s\S]*?will-change:\s*opacity;/);
assert.match(staticCard, /\.hp-static-stage > \.hp-paper-outline-svg \{[\s\S]*?z-index:\s*0;/);
assert.match(styles, /\.hp-static-stage\.daycycle \.hp-paper-outline-svg/);
assert.match(styles, /\.hp-static-stage\.daycycle \.hp-paperg \{[\s\S]*?filter:\s*none;[\s\S]*?will-change:\s*auto;/);
});