From 3eac2b9fe22940b57b2bf5a683d1b9489ec6c71a Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Tue, 6 Nov 2018 16:55:14 +0000 Subject: [PATCH] test: failing for duplicate VMID in same metaInfo --- test/getMetaInfo.spec.js | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/getMetaInfo.spec.js b/test/getMetaInfo.spec.js index e72ab33..87627c1 100644 --- a/test/getMetaInfo.spec.js +++ b/test/getMetaInfo.spec.js @@ -75,6 +75,47 @@ describe('getMetaInfo', () => { __dangerouslyDisableSanitizersByTagID: {} }) }) + it('removes duplicate metaInfo in same component', () => { + component = new Vue({ + metaInfo: { + title: 'Hello', + meta: [ + { + vmid: 'a', + property: 'a', + content: 'a' + }, + { + vmid: 'a', + property: 'a', + content: 'b' + } + ] + } + }) + expect(getMetaInfo(component)).to.eql({ + title: 'Hello', + titleChunk: 'Hello', + titleTemplate: '%s', + htmlAttrs: {}, + headAttrs: {}, + bodyAttrs: {}, + meta: [ + { + vmid: 'a', + property: 'a', + content: 'b' + } + ], + base: [], + link: [], + style: [], + script: [], + noscript: [], + __dangerouslyDisableSanitizers: [], + __dangerouslyDisableSanitizersByTagID: {} + }) + }) it('properly uses string titleTemplates', () => { component = new Vue({