Vuetify: [Bug Report] Testing with Vue-Test-Utils - Mount fails on Second Attempt

Created on 28 Nov 2019  路  3Comments  路  Source: vuetifyjs/vuetify

Environment

Vuetify Version: 2.1.12
Vue Version: 2.6.10
Browsers: Other
OS: Windows 10

Steps to reproduce

  1. Clone Repository
  2. npm install
  3. npm run test:unit

Expected Behavior

Four tests have been written each just wrapping a component utilizing Vuetify and mounting it.

As all tests are exactly the same it is expected for them all to succeed and behave in the same way.

Actual Behavior

mount is failing on the second execution reproducible producing the error

TypeError: Cannot read property '$scopedSlots' of undefined

Test Executions 1,3 and 4 behave as expected

Reproduction Link

https://github.com/relief-melone/rm-test-mount-fails-on-second-exec.git

Other comments

I cannot be 100% sure if this issue is caused by Vuetify or the Test Utils (So i created this issue in both Projects). I have been trying alot of different configurations of using localVue Vuetify or vuetify created from new Vuetify but had no luck. There is also a thread open on StackOverflow.
(https://stackoverflow.com/questions/59070770/testing-vuetify-vue-js-second-call-on-mount-throws-error)

Another user mentioned he did not get the wrong behaviour on version 1.5.21

Versions:

Vue: 2.6.10
Vue-Test-Utils: 1.0.0-beta.29
Vuetify: 2.1.12

duplicate

All 3 comments

Duplicate of #9151

Thanks for the quick reply. I am not quite sure if this is a duplicate though. Issue #9151 states it has problems using shallowMount after mount, but this example doesn't use shallowMount. And I think it is a serious bug, that you cannot expect for 2 identical tests to behave in the same way.

I think they are strongly related though as ue-test-utils #1130 states a workaround that should work is using sync false. As this also helps in this case I guess the root cause is the same

So I think this can stay closed for now

Duplicate doesn't necessarily mean the symptoms are the same.

Was this page helpful?
0 / 5 - 0 ratings