Skip to content

Commit

Permalink
test(vdom): add test case for #7786 (#7793)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkzing authored and yyx990803 committed Mar 11, 2018
1 parent 71b4b25 commit 666cdbd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/modules/vdom/create-element.spec.js
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 666cdbd

Please sign in to comment.