mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-04 13:48:57 +00:00
fix: preserve editor behavior across lazy runtime
Issue: #337 User-Visible: no
This commit is contained in:
@@ -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['"]/);
|
||||
|
||||
Reference in New Issue
Block a user