mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-22 06:00:35 +03:00
feat: child can indicate parent vmid to be removed (resolves: #288)
This commit is contained in:
committed by
Alexander Lichter
parent
22e456cbe2
commit
915fedfb7f
@@ -671,4 +671,52 @@ describe('getMetaInfo', () => {
|
||||
__dangerouslyDisableSanitizersByTagID: {}
|
||||
})
|
||||
})
|
||||
|
||||
test('child can indicate to remove parent vmids', () => {
|
||||
Vue.component('merge-child', {
|
||||
render: h => h('div'),
|
||||
metaInfo: {
|
||||
title: 'Hi',
|
||||
meta: [
|
||||
{
|
||||
vmid: 'og:title',
|
||||
content: null
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const component = new Vue({
|
||||
metaInfo: {
|
||||
title: 'Hello',
|
||||
meta: [
|
||||
{
|
||||
vmid: 'og:title',
|
||||
property: 'og:title',
|
||||
content: 'Test title',
|
||||
template: chunk => `${chunk} - My page`
|
||||
}
|
||||
]
|
||||
},
|
||||
el: document.createElement('div'),
|
||||
render: h => h('div', null, [h('merge-child')])
|
||||
})
|
||||
|
||||
expect(getMetaInfo(component)).toEqual({
|
||||
title: 'Hi',
|
||||
titleChunk: 'Hi',
|
||||
titleTemplate: '%s',
|
||||
htmlAttrs: {},
|
||||
headAttrs: {},
|
||||
bodyAttrs: {},
|
||||
meta: [],
|
||||
base: [],
|
||||
link: [],
|
||||
style: [],
|
||||
script: [],
|
||||
noscript: [],
|
||||
__dangerouslyDisableSanitizers: [],
|
||||
__dangerouslyDisableSanitizersByTagID: {}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user