2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-05 09:12:25 +03:00

test: add tests for new functionalities

This commit is contained in:
pimlie
2019-09-13 18:05:07 +02:00
committed by Pim
parent c1b01b991f
commit a2f0e7df3c
10 changed files with 275 additions and 31 deletions
-2
View File
@@ -43,8 +43,6 @@ export default function updateAttribute (appId, { attribute } = {}, type, attrs,
if (attrs[attr]) {
data[attr] = data[attr] || {}
data[attr][appId] = attrs[attr]
} else {
delete data[attr][appId]
}
}
}
+1 -1
View File
@@ -28,6 +28,6 @@ function install (Vue, options = {}) {
export default {
version,
install,
generate: process.server ? generate : () => showWarningNotSupportedInBrowserBundle('generate'),
generate: metaInfo => process.server ? generate(metaInfo) : showWarningNotSupportedInBrowserBundle('generate'),
hasMetaInfo
}
+9 -7
View File
@@ -58,13 +58,15 @@ export default function generateServerInjector (options, metaInfo) {
}
}
for (const appId in serverInjector.extraData) {
const data = serverInjector.extraData[appId][type]
if (data) {
for (const attr in data) {
attributeData[attr] = {
...attributeData[attr],
[appId]: data[attr]
if (serverInjector.extraData) {
for (const appId in serverInjector.extraData) {
const data = serverInjector.extraData[appId][type]
if (data) {
for (const attr in data) {
attributeData[attr] = {
...attributeData[attr],
[appId]: data[attr]
}
}
}
}
+1
View File
@@ -155,6 +155,7 @@ export default function createMixin (Vue, options) {
// Wait that element is hidden before refreshing meta tags (to support animations)
const interval = setInterval(() => {
if (this.$el && this.$el.offsetParent !== null) {
/* istanbul ignore next line */
return
}