mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
coverage PageFooter.spec.js
This commit is contained in:
parent
7e165a9b2b
commit
38a6fbbed2
40
webapp/components/PageFooter/PageFooter.spec.js
Normal file
40
webapp/components/PageFooter/PageFooter.spec.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import { config, mount } from '@vue/test-utils'
|
||||||
|
import PageFooter from './PageFooter.vue'
|
||||||
|
import links from '~/constants/links.js'
|
||||||
|
|
||||||
|
const localVue = global.localVue
|
||||||
|
|
||||||
|
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
||||||
|
|
||||||
|
describe('PageFooter.vue', () => {
|
||||||
|
let mocks
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
mocks = {
|
||||||
|
$t: jest.fn(),
|
||||||
|
$env: {
|
||||||
|
VERSION: 'v1.0.0'
|
||||||
|
},
|
||||||
|
links
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('mount', () => {
|
||||||
|
let wrapper
|
||||||
|
const Wrapper = () => {
|
||||||
|
return mount(PageFooter, { mocks, localVue })
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = Wrapper()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders three links', () => {
|
||||||
|
expect(wrapper.findAll('a')).toHaveLength(3)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders four nuxt-links', () => {
|
||||||
|
expect(wrapper.findAll('.nuxt-link')).toHaveLength(4)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user