mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
coverage post/_id.spec.js
coverage post/create.spec.js
This commit is contained in:
parent
d2347ba2d8
commit
609836d48c
37
webapp/pages/post/_id.spec.js
Normal file
37
webapp/pages/post/_id.spec.js
Normal file
@ -0,0 +1,37 @@
|
||||
import { config, mount } from '@vue/test-utils'
|
||||
import _id from './_id.vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
config.stubs['nuxt-child'] = '<span class="nuxt-child"><slot /></span>'
|
||||
|
||||
describe('post/_id.vue', () => {
|
||||
let wrapper
|
||||
let mocks
|
||||
|
||||
beforeEach(() => {
|
||||
mocks = {
|
||||
$t: jest.fn(),
|
||||
$route: {
|
||||
params: {
|
||||
id: '1234',
|
||||
slug: 'my-post',
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
describe('mount', () => {
|
||||
const Wrapper = () => {
|
||||
return mount(_id, { mocks, localVue })
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders', () => {
|
||||
expect(wrapper.findAll('.post-side-navigation')).toHaveLength(1)
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
30
webapp/pages/post/create.spec.js
Normal file
30
webapp/pages/post/create.spec.js
Normal file
@ -0,0 +1,30 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import create from './create.vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('create.vue', () => {
|
||||
let wrapper
|
||||
let mocks
|
||||
|
||||
beforeEach(() => {
|
||||
mocks = {
|
||||
$t: jest.fn(),
|
||||
}
|
||||
})
|
||||
|
||||
describe('mount', () => {
|
||||
const Wrapper = () => {
|
||||
return mount(create, { mocks, localVue })
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders', () => {
|
||||
expect(wrapper.findAll('.contribution-form')).toHaveLength(1)
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user