2
0
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:
pimlie
2019-03-08 16:40:43 +01:00
committed by Alexander Lichter
parent 6e18a7d54a
commit 01edc8c242
4 changed files with 52 additions and 4 deletions
+40
View File
@@ -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: {}
})
})
})