Skip to content

Commit 2149091

Browse files
committed
Fix e2e tests breaking by moving the click handler outside createMap
1 parent 4937238 commit 2149091

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/clients/snowbox/src/polar-client.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ const createMap = (layerConf) => {
2121
.then((map) => {
2222
// @ts-expect-error | adding it intentionally for e2e testing
2323
window.mapInstance = map
24-
document
25-
.getElementById('vuex-target-clicky')!
26-
.addEventListener('click', () => {
27-
map.$store.dispatch(
28-
'plugin/gfi/setFeatureInformation',
29-
exampleFeatureInformation
30-
)
31-
})
3224
addStoreSubscriptions(
3325
['plugin/zoom/zoomLevel', 'vuex-target-zoom'],
3426
[
@@ -89,3 +81,11 @@ document
8981
target[1].innerHTML = value === 'en' ? 'German' : 'Deutsch'
9082
})
9183
})
84+
85+
document.getElementById('vuex-target-clicky')!.addEventListener('click', () =>
86+
// @ts-expect-error | added for e2e testing
87+
window.mapInstance.$store.dispatch(
88+
'plugin/gfi/setFeatureInformation',
89+
exampleFeatureInformation
90+
)
91+
)

0 commit comments

Comments
 (0)