0👍
The answer is because you are mocking the $store
property on your component, but you aren’t using that way in your component. Your component is using the ...mapState()
method, which will automatically expect that a Vuex.Store()
was instantiated on a local copy of Vue. Take a look at the following link to properly mock up a Store for a local component’s unit / integration test(s):
https://vue-test-utils.vuejs.org/guides/using-with-vuex.html
Quick shoutout to @Anatoly, who provided the link.
- [Vuejs]-Vuex state mutation detected by Vue Dev Tools – component fails to detect change
- [Vuejs]-VueJS binding custom directives to looped components based on condition
Source:stackexchange.com