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:
@@ -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: {}
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user