mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
Merge pull request #3052 from gradido/more-unit-tests-frontend
feat(frontend): test right side layout template
This commit is contained in:
commit
5422246e11
50
frontend/src/layouts/templates/RightSide.spec.js
Normal file
50
frontend/src/layouts/templates/RightSide.spec.js
Normal 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')
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user