mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-02 12:49:56 +00:00
Validate / hacs (push) Failing after 10s
Validate / hassfest (push) Failing after 11s
Validate / frontend (push) Successful in 4m20s
Validate / backend (push) Failing after 4m47s
Validate / golden (push) Failing after 6m33s
Validate / performance_smoke (push) Failing after 9m34s
Validate / smoke (push) Failing after 19m8s
17 lines
775 B
JavaScript
17 lines
775 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import test from 'node:test';
|
|
|
|
const source = readFileSync(new URL('../src/houseplan-card.ts', import.meta.url), 'utf8');
|
|
|
|
test('native selects never rely on value assignment before dynamic options mount', () => {
|
|
const blocks = [...source.matchAll(/<select\b[\s\S]*?<\/select>/g)].map((match) => match[0]);
|
|
const valueBoundIds = blocks
|
|
.filter((block) => /\.value\s*=\s*\$\{/.test(block))
|
|
.map((block) => block.match(/\bid="([^"]+)"/)?.[1] || '(missing id)');
|
|
|
|
// This is a command menu, not persisted state: it intentionally resets to
|
|
// its empty first row after inserting an HA variable into decorative text.
|
|
assert.deepEqual(valueBoundIds, ['decor-live-attribute']);
|
|
});
|