coverage PageFooter.spec.js

This commit is contained in:
Ulf Gebhardt 2021-04-24 12:54:09 +02:00
parent 7e165a9b2b
commit 38a6fbbed2
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View 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)
})
})
})