Skip to content

Commit

Permalink
test(vdom): add test case for vuejs#7786 (vuejs#7793)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkzing authored and aJean committed Aug 19, 2020
1 parent e54df9f commit 03e2397
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/modules/vdom/create-element.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,24 @@ describe('create-element', () => {
expect(vm.$el.querySelector('input').value).toBe('b')
}).then(done)
})

// #7786
it('creates element with vnode reference in :class or :style', () => {
const vm = new Vue({
components: {
foo: {
render (h) {
return h('div', {
class: {
'has-vnode': this.$vnode
}
}, 'foo')
}
}
},
render: h => h('foo')
}).$mount()
expect(vm.$el.innerHTML).toContain('foo')
expect(vm.$el.classList.contains('has-vnode')).toBe(true)
})
})

0 comments on commit 03e2397

Please sign in to comment.