mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
test head post/_id/_slug/index.spec.js
This commit is contained in:
parent
d151251c95
commit
44038a46ab
@ -4,6 +4,7 @@ import Vue from 'vue'
|
||||
import PostSlug from './index.vue'
|
||||
import CommentList from '~/components/CommentList/CommentList'
|
||||
import HcHashtag from '~/components/Hashtag/Hashtag'
|
||||
import VueMeta from 'vue-meta'
|
||||
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
@ -11,6 +12,7 @@ config.stubs['router-link'] = '<span><slot /></span>'
|
||||
|
||||
const localVue = global.localVue
|
||||
localVue.directive('scrollTo', jest.fn())
|
||||
localVue.use(VueMeta, { keyName: 'head' })
|
||||
|
||||
describe('PostSlug', () => {
|
||||
let wrapper, Wrapper, backendData, mocks, stubs
|
||||
@ -91,6 +93,11 @@ describe('PostSlug', () => {
|
||||
return wrapper
|
||||
}
|
||||
|
||||
it('has correct <head> content', async () => {
|
||||
wrapper = await Wrapper()
|
||||
expect(wrapper.vm.$metaInfo.title).toBe('loading')
|
||||
})
|
||||
|
||||
describe('given author is `null`', () => {
|
||||
it('does not crash', async () => {
|
||||
backendData = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user