fix: preserve editor behavior across lazy runtime

Issue: #337
User-Visible: no
This commit is contained in:
Matysh
2026-08-28 05:40:28 +00:00
committed by claude[bot]
parent 37a5d14569
commit 9b519b0d4c
28 changed files with 441 additions and 305 deletions
+11
View File
@@ -121,6 +121,17 @@ test('source type references stay portable across build hosts', () => {
);
});
test('lazy runtime event handlers keep the runtime receiver', () => {
const runtime = readFileSync(join(repoRoot, 'src', 'houseplan-editor-runtime.ts'), 'utf8');
const bareHandlers = [...runtime.matchAll(/@[a-zA-Z-]+=\$\{this\.(_[A-Za-z0-9]+)\}/g)]
.map((match) => match[1]);
assert.deepEqual(
bareHandlers,
[],
`Lit binds bare listeners to the host element, not the lazy runtime: ${bareHandlers.join(', ')}`,
);
});
test('documentation capture materializes the complete bundle tree', () => {
const capture = readFileSync(join(repoRoot, 'demo', 'docs', 'capture.mjs'), 'utf8');
assert.match(capture, /import ['"]\.\.\/\.\.\/scripts\/bundle-sync\.mjs['"]/);