2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-08 17:12:26 +03:00

test getComponentOption function call

This commit is contained in:
Declan de Wet
2016-11-10 15:51:00 +02:00
parent 6502c13793
commit beda7041d0
+11
View File
@@ -19,6 +19,17 @@ describe('getComponentOption', () => {
expect(mergedOption).to.eql('foo')
})
it('calls a function option, injecting the component as context', () => {
component = new Vue({
name: 'foobar',
someFunc () {
return this.$options.name
}
})
const mergedOption = getComponentOption({ component, option: 'someFunc' })
expect(mergedOption).to.eql('foobar')
})
it('fetches deeply nested component options and merges them', () => {
Vue.component('merge-child', { template: '<div></div>', foo: { bar: 'baz' } })