Skip to content

mount fails on second attempt #1359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
relief-melone opened this issue Nov 28, 2019 · 4 comments
Closed

mount fails on second attempt #1359

relief-melone opened this issue Nov 28, 2019 · 4 comments

Comments

@relief-melone
Copy link

relief-melone commented Nov 28, 2019

Version

1.0.0-beta.29

Reproduction link

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

Steps to reproduce

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

What is expected?

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.

What is actually happening?

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


I cannot be 100% sure if this issue is caused by Vuetify or the Test Utils. 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

@relief-melone
Copy link
Author

relief-melone commented Nov 29, 2019

Not exactly the same but I guess the root cause is the same as stated in #1130. In any case the workaround setting sync to false works. In my opinion this is still a serious bug as identical tests should always have the same outcome but at least there is a way to work with it. If anybody is struggeling with this as I did use

const wrapper = mount(BugExample, {
  localVue,
  vuetify,
  propsData: { value: [] },
  sync: false
});

@lmiller1990
Copy link
Member

Does this still occur in v30? (Sync mode removed in v30)

@JessicaSachs
Copy link
Collaborator

This is fixed in v30. I checked out the reproduction repo. I was able to reproduce the failure in v29 and then when I upgrade to v30, everything works fine.
@relief-melone I'm going to close this issue. Please reopen if upgrading with npm i -D @vue/[email protected] does not solve your issue.

@relief-melone
Copy link
Author

Hey,

sorry for the late reply. I can confirm that this fixed the error. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants