You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
636 B

import Vue from 'vue'
describe('Options functional', () => {
it('should work', done => {
const vm = new Vue({
data: { test: 'foo' },
template: '<div><wrap :msg="test">bar</wrap></div>',
components: {
wrap: {
functional: true,
props: ['msg'],
render (h, props, children) {
return h('div', null, [props.msg, ' '].concat(children))
}
}
}
}).$mount()
expect(vm.$el.innerHTML).toBe('<div>foo bar</div>')
vm.test = 'qux'
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe('<div>qux bar</div>')
}).then(done)
})
})