Skip to content

Commit

Permalink
Fix e2e tests breaking by moving the click handler outside createMap
Browse files Browse the repository at this point in the history
  • Loading branch information
dopenguin committed Jan 6, 2025
1 parent 4937238 commit 2149091
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/clients/snowbox/src/polar-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ const createMap = (layerConf) => {
.then((map) => {
// @ts-expect-error | adding it intentionally for e2e testing
window.mapInstance = map
document
.getElementById('vuex-target-clicky')!
.addEventListener('click', () => {
map.$store.dispatch(
'plugin/gfi/setFeatureInformation',
exampleFeatureInformation
)
})
addStoreSubscriptions(
['plugin/zoom/zoomLevel', 'vuex-target-zoom'],
[
Expand Down Expand Up @@ -89,3 +81,11 @@ document
target[1].innerHTML = value === 'en' ? 'German' : 'Deutsch'
})
})

document.getElementById('vuex-target-clicky')!.addEventListener('click', () =>
// @ts-expect-error | added for e2e testing
window.mapInstance.$store.dispatch(
'plugin/gfi/setFeatureInformation',
exampleFeatureInformation
)
)

0 comments on commit 2149091

Please sign in to comment.