Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test
  • Loading branch information
Haroenv committed Oct 7, 2020
commit a9a98264fffe6dfc6992245802042cb98e4223b4
25 changes: 25 additions & 0 deletions test/specs/wrapper/setData.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,29 @@ describeWithShallowAndMount('setData', mountingMethod => {
await wrapper.setData({ selectedDate: testDate })
expect(wrapper.vm.selectedDate).toEqual(testDate)
})

it('allows empty objects to be set', () => {
const TestComponent = {
data() {
return {
someKey: { someValue: true }
}
},
render(h) {
return h('span')
}
}

const wrapper = mountingMethod(TestComponent)

expect(wrapper.vm.$data).toEqual({ someKey: { someValue: true } })

wrapper.setData({ someKey: {} })

expect(wrapper.vm.$data).toEqual({ someKey: {} })

wrapper.setData({ someKey: { someValue: false } })

expect(wrapper.vm.$data).toEqual({ someKey: { someValue: false } })
})
})