Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Write tests #1

Open
schlunsen opened this issue Mar 13, 2018 · 1 comment
Open

Write tests #1

schlunsen opened this issue Mar 13, 2018 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@schlunsen
Copy link
Owner

No description provided.

@schlunsen schlunsen added the help wanted Extra attention is needed label Mar 13, 2018
schlunsen pushed a commit that referenced this issue Sep 7, 2019
@danieldanielecki
Copy link

+1, some kind of unit tests would be needed. In addition to that, the <client-only> breaks all unit tests, and it's not possible to register the component, as the other ones in unit tests, such as l-map, via Vue.component("l-map", LMap); etc.

In addition to that,

created(): void {
  this.$nextTick(() => {
    this.myMap = this.$refs.map.mapObject; // "this.$refs.map.mapObject" is a Leaflet object. Read more: https://vue2- 
 leaflet.netlify.app/faq/#how-can-i-access-the-leaflet-map-object
    this.myMap.setView([lat, lng], 12);
    ...
  }
}

breaks unit tests with the error console.error TypeError: Cannot read property 'setView' of undefined

Last, but not least, might be related to this. All the time after implementing nuxt-leaflet, I can see in my terminal [Vue warn]: Error in nextTick: "TypeError: Cannot read property 'mapObject' of undefined" while running the app locally npm run dev.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants