mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
(а) title: null gets the same compact frame as title: '' — YAML 'title:' with no value parses as null, the owner's decision makes them synonyms. (б) the guides state that room labels are inert in the Background editor. (г) furniture strokes skip the flat-camera compensation in the labs iso projection, tracking ordinary decor there. (д) TESTING.md notes the light_pools opt-in for static room cards. (е) the space-card dispose gate mirrors the strict === true render gate. User-Visible: yes Issue: #376
26 lines
1.3 KiB
JavaScript
26 lines
1.3 KiB
JavaScript
import test from 'node:test';
|
||
import assert from 'node:assert/strict';
|
||
import { readFileSync } from 'node:fs';
|
||
|
||
const card = readFileSync(new URL('../src/space-card.ts', import.meta.url), 'utf8');
|
||
|
||
// #376(а): YAML `title:` with no value parses as null. The owner decided null
|
||
// and '' mean the same thing — no header AND the compact frame. The behaviour
|
||
// is proven end-to-end by demo/smoke_space_card.mjs (nullTitleFrame); this
|
||
// contract keeps the condition from silently narrowing back to '' only.
|
||
test('#376(а) the compact frame accepts both the empty string and null title', () => {
|
||
assert.match(card,
|
||
/compactTopFrame: this\._config\.title === '' \|\| this\._config\.title === null,/);
|
||
});
|
||
|
||
// #376(е): the render gate is strict `=== true`; the dispose gate must be its
|
||
// exact mirror, so a truthy-but-not-true value (light_pools: 1) neither draws
|
||
// pools nor keeps a glow runtime and a blend probe alive.
|
||
test('#376(е) light_pools gates are symmetric: anything but true disposes', () => {
|
||
assert.match(card, /lightPools: this\._config\.light_pools === true,/);
|
||
assert.match(card,
|
||
/if \(this\._config\.light_pools !== true\) \{\s*\n\s*disposeGlowRuntime\(/);
|
||
assert.ok(!/if \(!this\._config\.light_pools\) \{\s*\n\s*disposeGlowRuntime\(/.test(card),
|
||
'the old truthy dispose gate must not return');
|
||
});
|