Merge pull request #3052 from gradido/more-unit-tests-frontend

feat(frontend): test right side layout template
This commit is contained in:
mahula 2023-07-04 10:20:31 +02:00 committed by GitHub
commit 5422246e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,50 @@
import { mount } from '@vue/test-utils'
import RightSide from './RightSide'
const localVue = global.localVue
describe('RightSide', () => {
let wrapper
const mocks = {
$route: {
path: '/community/contribute',
},
}
const Wrapper = () => {
return mount(RightSide, { localVue, mocks })
}
describe('at /community/contribute', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('has name set to "community"', () => {
expect(wrapper.vm.name).toBe('community')
})
})
describe('at /settings', () => {
beforeEach(() => {
mocks.$route.path = '/settings'
wrapper = Wrapper()
})
it('has name set to "empty"', () => {
expect(wrapper.vm.name).toBe('empty')
})
})
describe('at /overview', () => {
beforeEach(() => {
mocks.$route.path = '/overview'
wrapper = Wrapper()
})
it('has name set to "transactions"', () => {
expect(wrapper.vm.name).toBe('transactions')
})
})
})