Test that the language switch is present if not on register page.

This commit is contained in:
elweyn 2022-01-12 10:03:19 +01:00
parent dccb8cb2ae
commit 29b8e362e2

View File

@ -1,5 +1,6 @@
import { mount } from '@vue/test-utils'
import AuthLayoutGdd from './AuthLayout_gdd'
import LanguageSwitch from '../../components/LanguageSwitch'
const localVue = global.localVue
@ -15,6 +16,7 @@ describe('AuthLayoutGdd', () => {
meta: {
hideFooter: false,
},
path: '/',
},
$store: {
state: {},
@ -47,5 +49,20 @@ describe('AuthLayoutGdd', () => {
it('has a footer inside the main content', () => {
expect(wrapper.find('div.main-content').find('footer.footer').exists()).toBeTruthy()
})
it('has LanguageSwitch', () => {
expect(wrapper.findComponent(LanguageSwitch).exists()).toBeTruthy()
})
describe('check LanguageSwitch on register page', () => {
beforeEach(() => {
mocks.$route.path = '/register'
wrapper = Wrapper()
})
it('has not LanguageSwitch', () => {
expect(wrapper.findComponent(LanguageSwitch).exists()).toBeFalsy()
})
})
})
})