Files
houseplan-card/test/room-temperature-renderers.test.mjs
2026-09-08 10:44:13 +03:00

16 lines
747 B
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const read = (name) => readFileSync(new URL(`../src/${name}`, import.meta.url), 'utf8');
test('#487 full and static renderers consume one effective room temperature range', () => {
const full = read('houseplan-card.ts');
const staticCard = read('space-render.ts');
assert.match(full, /const tempRange = roomTempRangeFromDraft\(/);
assert.match(full, /tempRange\.min,\s*tempRange\.max,/);
assert.match(staticCard, /const tempRange = roomTempRangeOf\(/);
assert.match(staticCard, /tempRange\.min,\s*tempRange\.max,/);
assert.doesNotMatch(staticCard, /fill === 'temp'[\s\S]{0,180}disp\.tempMin,[\s\n ]*disp\.tempMax/);
});