refactor: separate traffic and bikeshare components

This commit is contained in:
Sameh Khamis committed 2026-09-13 14:10:38 -07:00
1 parent 3143d00c90
commit 903fe6ba37
45 files changed
+6159 -4363

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
export function createTesting({ state: layerState, services, parts, source }) {
/** Seed a selected-station runtime record while still exercising real select/clear paths. */
function _setBikeshareSelectionStateForTest({
viewer,
key,
record,
overlayHost,
}) {
layerState._viewer = viewer;
layerState._stationRenderMap = new Map([[key, record]]);
layerState._selectedKey = null;
layerState._selectedEntity = null;
layerState._overlayHost = overlayHost || layerState.DEFAULT_OVERLAY_HOST;
}
/** Exercise the production selection path in focused runtime tests. */
function _selectBikeshareStationForTest(key) {
parts.selection._selectStation(key);
}
/** Exercise the production clear path and restore the production host seam. */
function _clearBikeshareSelectionForTest() {
parts.selection._clearSelection();
layerState._overlayHost = layerState.DEFAULT_OVERLAY_HOST;
}
return {
_setBikeshareSelectionStateForTest,
_selectBikeshareStationForTest,
_clearBikeshareSelectionForTest,
};
}