mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
feat(firms): add Navara renderer checkpoint
This commit is contained in:
1 parent
a9b3125a99
commit
5dd05a4a81
33 files changed
+2112
-285
No files matched your search
@@ -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);
|
||||
});
|
||||
Reference in new issue
Block a user