Skip to content
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

setData() doesn't set data correctly #495

Closed
Remeic opened this issue Mar 28, 2018 · 1 comment
Closed

setData() doesn't set data correctly #495

Remeic opened this issue Mar 28, 2018 · 1 comment

Comments

@Remeic
Copy link

Remeic commented Mar 28, 2018

Version

2.5.16

Reproduction link

https://github.com/Remeic/vue-highlighter/tree/tests

Steps to reproduce

Clone repository, checkout on tests branch and run yarn test

What is expected?

wrapper.setData() change data of App correctly and directive can update the highlighted word

What is actually happening?

setData doesn't update correctly the data and console print "Cannot read property 'split' of undefined", seems wrapper is not mounted, if i remove data from App.vue SFC error changes and it is "Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."

@eddyerburgh
Copy link
Member

Thanks for the bug report.

I believe this is an issue with your directive. If you change the data in your component with setTimeout the directive does not update correctly.

Another issue, which is causing the error you are seeing, is that JSDOM doesn't support innerText—jsdom/jsdom#1245

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

2 participants