Skip to content

Commit 9491760

Browse files
committed
Fix flaky issue with Unit test not having a default projection available
1 parent 59eed6d commit 9491760

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/router/storeSync/storeSync.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ZoomParamConfig from '@/router/storeSync/ZoomParamConfig.class.js'
1111
import { FeatureInfoPositions } from '@/store/modules/ui.store'
1212

1313
import CompareSliderParamConfig from './CompareSliderParamConfig.class'
14+
1415
/**
1516
* Configuration for all URL parameters of this app that need syncing with the store (and
1617
* vice-versa)
@@ -33,7 +34,9 @@ const storeSyncConfig = [
3334
(store) => store.state.position.projection.epsgNumber,
3435
false,
3536
Number,
36-
DEFAULT_PROJECTION.epsgNumber,
37+
// Unit tests somehow come to this line without having set DEFAULT_PROJECTION correcty.
38+
// So as defensive measure for this, we set a "just in case" default hard-coded value.
39+
DEFAULT_PROJECTION?.epsgNumber ?? 2056,
3740
'projection'
3841
),
3942
// Position must be processed after the projection param,

0 commit comments

Comments
 (0)