feat(frontend): test right side layout template

This commit is contained in:
Moriz Wahl 2023-06-13 13:50:48 +02:00
parent 0e6ae70c8d
commit 3792a49102

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