Skip to content

Commit

Permalink
test: Adding an observer spec for new feature to catch properties bei…
Browse files Browse the repository at this point in the history
…ng set that already have been c

fix vuejs#8129
  • Loading branch information
bigtunacan committed May 8, 2018
1 parent 6fecabe commit 3aea4dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/modules/observer/observer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,21 @@ describe('Observer', () => {
}).then(done)
})

it('Cannot enable reactivity on a property that is already defined', done => {
const vm = new Vue({
data: {
person: {
age: 32
}
}
}).$mount()
vm.person.job = 'Programmer'
Vue.set(vm.person, 'job', 'Educator')
waitForUpdate(() => {
expect(`Cannot enable reactivity on a property that is already defined`).toHaveBeenWarned()
}).end(done)
})

it('warning set/delete on Vue instance root $data', done => {
const data = { a: 1 }
const vm = new Vue({
Expand Down

0 comments on commit 3aea4dd

Please sign in to comment.