Skip to content

Commit 666cdbd

Browse files
jkzingyyx990803
authored andcommitted
test(vdom): add test case for #7786 (#7793)
1 parent 71b4b25 commit 666cdbd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/unit/modules/vdom/create-element.spec.js

+20
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,24 @@ describe('create-element', () => {
253253
expect(vm.$el.querySelector('input').value).toBe('b')
254254
}).then(done)
255255
})
256+
257+
// #7786
258+
it('creates element with vnode reference in :class or :style', () => {
259+
const vm = new Vue({
260+
components: {
261+
foo: {
262+
render (h) {
263+
return h('div', {
264+
class: {
265+
'has-vnode': this.$vnode
266+
}
267+
}, 'foo')
268+
}
269+
}
270+
},
271+
render: h => h('foo')
272+
}).$mount()
273+
expect(vm.$el.innerHTML).toContain('foo')
274+
expect(vm.$el.classList.contains('has-vnode')).toBe(true)
275+
})
256276
})

0 commit comments

Comments
 (0)