gradido/frontend/src/views/Layout/AuthLayout_gdd.spec.js
2021-10-16 15:14:38 +02:00

52 lines
1.0 KiB
JavaScript

import { mount } from '@vue/test-utils'
import AuthLayoutGdd from './AuthLayout_gdd'
const localVue = global.localVue
describe('AuthLayoutGdd', () => {
let wrapper
const mocks = {
$i18n: {
locale: 'en',
},
$t: jest.fn((t) => t),
$route: {
meta: {
hideFooter: false,
},
},
$store: {
state: {},
commit: jest.fn(),
},
}
const stubs = {
// RouterLink: RouterLinkStub,
RouterView: true,
}
const Wrapper = () => {
return mount(AuthLayoutGdd, { localVue, mocks, stubs })
}
describe('mount', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('has no sidebar', () => {
expect(wrapper.find('nav#sidenav-main').exists()).not.toBeTruthy()
})
it('has a main content div', () => {
expect(wrapper.find('div.main-content').exists()).toBeTruthy()
})
it('has a footer inside the main content', () => {
expect(wrapper.find('div.main-content').find('footer.footer').exists()).toBeTruthy()
})
})
})