mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-19 06:30:33 +03:00
feat: attr keys can have array values (resolves #231)
This commit is contained in:
committed by
Alexander Lichter
parent
6e18a7d54a
commit
01edc8c242
@@ -719,4 +719,44 @@ describe('getMetaInfo', () => {
|
||||
__dangerouslyDisableSanitizersByTagID: {}
|
||||
})
|
||||
})
|
||||
|
||||
test('attribute values can be an array', () => {
|
||||
Vue.component('merge-child', {
|
||||
render: h => h('div'),
|
||||
metaInfo: {
|
||||
bodyAttrs: {
|
||||
class: ['foo']
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const component = new Vue({
|
||||
metaInfo: {
|
||||
bodyAttrs: {
|
||||
class: ['bar']
|
||||
}
|
||||
},
|
||||
el: document.createElement('div'),
|
||||
render: h => h('div', null, [h('merge-child')])
|
||||
})
|
||||
|
||||
expect(getMetaInfo(component)).toEqual({
|
||||
title: '',
|
||||
titleChunk: '',
|
||||
titleTemplate: '%s',
|
||||
htmlAttrs: {},
|
||||
headAttrs: {},
|
||||
bodyAttrs: {
|
||||
class: ['bar', 'foo']
|
||||
},
|
||||
meta: [],
|
||||
base: [],
|
||||
link: [],
|
||||
style: [],
|
||||
script: [],
|
||||
noscript: [],
|
||||
__dangerouslyDisableSanitizers: [],
|
||||
__dangerouslyDisableSanitizersByTagID: {}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user