diff --git a/frontend/src/views/Layout/AuthLayout_gdd.spec.js b/frontend/src/views/Layout/AuthLayout_gdd.spec.js new file mode 100644 index 000000000..aa05b772a --- /dev/null +++ b/frontend/src/views/Layout/AuthLayout_gdd.spec.js @@ -0,0 +1,51 @@ +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() + }) + }) +})