mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-07 17:52:24 +03:00
test: add options to generate test
This commit is contained in:
@@ -119,14 +119,16 @@ describe('plugin', () => {
|
||||
warn.mockRestore()
|
||||
})
|
||||
|
||||
test('can use generate export', () => {
|
||||
test('can use generate export with options', () => {
|
||||
process.server = true
|
||||
const rawInfo = {
|
||||
meta: [{ charset: 'utf-8' }]
|
||||
}
|
||||
|
||||
const metaInfo = VueMetaPlugin.generate(rawInfo)
|
||||
expect(metaInfo.meta.text()).toBe('<meta data-vue-meta="ssr" charset="utf-8">')
|
||||
const metaInfo = VueMetaPlugin.generate(rawInfo, {
|
||||
ssrAppId: 'my-test-app-id'
|
||||
})
|
||||
expect(metaInfo.meta.text()).toBe('<meta data-vue-meta="my-test-app-id" charset="utf-8">')
|
||||
|
||||
// no error on not provided metaInfo types
|
||||
expect(metaInfo.script.text()).toBe('')
|
||||
|
||||
Reference in New Issue
Block a user