You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Computed props are not reactive when using operation on primitive types, when they are used in template and the data, they are using, are setData() after mount/shallowMount
#656
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.
Computed props are not reactive when using operation on primitive types, when they are used in template and the data, they are using, are setData() after mount/shallowMount
import { mount } from '@vue/test-utils'
import Component from './Component.vue'
describe('components | Component', () => {
describe('template', () => {
it('should have a computedWorkers set to false because not empty', () => {
// Given
const wrapper = mount(Component)
// When
wrapper.setData({ workers: [{}] })
// Then
expect(wrapper.vm.$data.workers).toEqual([{}])
expect(wrapper.vm.computedWorkers).toEqual(false)
})
})
})
What is actually happening?
import { mount } from '@vue/test-utils'
import Component from './Component.vue'
describe('components | Component', () => {
describe('template', () => {
it('should have a computedWorkers set to false because not empty', () => {
// Given
const wrapper = mount(Component)
// When
wrapper.setData({ workers: [{}] })
// Then
expect(wrapper.vm.$data.workers).toEqual([{}])
expect(wrapper.vm.computedWorkers).toEqual(true)
})
})
})
could you provide a template of CodePen, CodeSandbox if you want a link, please?
The text was updated successfully, but these errors were encountered:
Version
1.0.0-beta.16
Reproduction link
http://google.com
Steps to reproduce
Computed props are not reactive when using operation on primitive types, when they are used in template and the data, they are using, are setData() after mount/shallowMount
Read the test to understand it
What is expected?
What is actually happening?
could you provide a template of CodePen, CodeSandbox if you want a link, please?
The text was updated successfully, but these errors were encountered: