2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-18 03:10:34 +03:00

feat: add option to refresh once during navigation (possible fix for #320)

chore: add es build

chore: global window detection

chore: small refactor improvements
This commit is contained in:
pimlie
2019-02-20 18:35:01 +01:00
parent 087e4abe76
commit 8e211751df
12 changed files with 145 additions and 7 deletions
+37
View File
@@ -0,0 +1,37 @@
import _getMetaInfo from '../src/shared/getMetaInfo'
import { defaultOptions, loadVueMetaPlugin } from './utils'
const getMetaInfo = (component, escapeSequences) => _getMetaInfo(defaultOptions, component, escapeSequences)
describe('escaping', () => {
let Vue
beforeAll(() => (Vue = loadVueMetaPlugin()))
test('special chars are escaped unless disabled', () => {
const component = new Vue({
metaInfo: {
title: 'Hello & Goodbye',
script: [{ innerHTML: 'Hello & Goodbye' }],
__dangerouslyDisableSanitizers: ['script']
}
})
expect(getMetaInfo(component, [[/&/g, '&']])).toEqual({
title: 'Hello & Goodbye',
titleChunk: 'Hello & Goodbye',
titleTemplate: '%s',
htmlAttrs: {},
headAttrs: {},
bodyAttrs: {},
meta: [],
base: [],
link: [],
style: [],
script: [{ innerHTML: 'Hello & Goodbye' }],
noscript: [],
__dangerouslyDisableSanitizers: ['script'],
__dangerouslyDisableSanitizersByTagID: {}
})
})
})