feat(firms): add Navara renderer checkpoint

This commit is contained in:
German Khokhlov committed 2026-10-28 09:36:50 +04:00
1 parent a9b3125a99
commit 5dd05a4a81
33 files changed
+2112 -285

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { createFirmsState } from './state.js';
import { createLifecycle } from './lifecycle.js';
test('destroy releases the owned generated PNG cache even when the layer facade remains referenced', () => {
const state = createFirmsState({ services: {}, config: {} });
state.glowSpriteCache.set(
'red:28',
'data:image/png;base64,' + 'x'.repeat(65536),
);
const noop = () => {};
const lifecycle = createLifecycle({
layerState: state,
services: {
picking: { unregisterPickOwner: noop },
context: { clearSelectedEntityContextForLayer: noop },
},
components: {
viewport: { removeLodWatcher: noop, removeMoveEndWatcher: noop },
selection: { removeClickHandler: noop, clearContextRegistrations: noop },
rendering: { removeDetectionCollections: noop },
},
config: {
id: 'firms-cache',
overlayHost: { clearSource: noop, setVisible: noop },
},
});
lifecycle.methods.destroy();
assert.equal(state.glowSpriteCache.size, 0);
lifecycle.methods.destroy();
assert.equal(state.glowSpriteCache.size, 0);
});