We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you call wrapper.setData({ someKey: {} }), it doesn't set the someKey to {}
wrapper.setData({ someKey: {} })
someKey
{}
this test doesn't pass
const wrapper = mount({ data() { return { someKey: { someValue: true }, }; }, render(h) { return h('span'); }, }); expect(wrapper.vm.$data).toEqual({ someKey: { someValue: true } }); wrapper.setData({ someKey: {} }); expect(wrapper.vm.$data).toEqual({ someKey: {} });
This test passes
The test doesn't pass, it still has the previous
In here: https://github.com/vuejs/vue-test-utils/blob/dev/packages/test-utils/src/recursively-set-data.js I think it might make sense to see if the object has keys at all, if it doesn't have keys, you could set the value.
The text was updated successfully, but these errors were encountered:
fix(setData): allow empty objects to be set
cda6e4b
fixes vuejs#1704 This is a tentative fix to show one possible solution, I can clean it up if you think it makes sense
993b293
Why this issue closed?? I have the same trouble and this solution is bullshit
Sorry, something went wrong.
Does #1705 not fix? That was the intention: Haroenv@cda6e4b
If you want to fork this repo and add a minimal repro, we can take a look.
No branches or pull requests
Subject of the issue
If you call
wrapper.setData({ someKey: {} })
, it doesn't set thesomeKey
to{}
Steps to reproduce
this test doesn't pass
Expected behaviour
This test passes
Actual behaviour
The test doesn't pass, it still has the previous
Possible Solution
In here: https://github.com/vuejs/vue-test-utils/blob/dev/packages/test-utils/src/recursively-set-data.js I think it might make sense to see if the object has keys at all, if it doesn't have keys, you could set the value.
The text was updated successfully, but these errors were encountered: