refactor: extract application construction and lifecycle

This commit is contained in:
Sameh Khamis committed 2026-09-11 17:02:54 -07:00
1 parent 092f28e301
commit 4d37760314
36 files changed
+1363 -382

No files matched your search

+1 -1
View File
@@ -2318,7 +2318,7 @@ const trafficLayer = {
viewer.camera.percentageChanged = _prevPercentageChanged;
_prevPercentageChanged = null;
}
_pointCollection.show = false;
if (_pointCollection) _pointCollection.show = false;
},
/**
+8
View File
@@ -151,3 +151,11 @@ test('the shipped layer boots keyless-honest before any status check', () => {
assert.ok(!LIVE_CLAIM.test(stats.loadingLabel), `boot label implies live data: ${stats.loadingLabel}`);
assert.equal(layerFeedState(stats), 'fallback');
});
test('traffic can be destroyed before its first enable and destroyed repeatedly', async () => {
const { default: traffic } = await import('./traffic.js');
const viewer = { camera: { changed: { removeEventListener() {} } } };
assert.doesNotThrow(() => traffic.destroy(viewer));
assert.doesNotThrow(() => traffic.destroy(viewer));
assert.equal(traffic.getStats().count, 0);
});