mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
refactor: separate traffic and bikeshare components
This commit is contained in:
1 parent
3143d00c90
commit
903fe6ba37
45 files changed
+6159
-4363
No files matched your search
@@ -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,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user