refactor tests

This commit is contained in:
ogerly 2022-06-08 22:35:58 +02:00
parent b0baa8e021
commit ab76a35095
3 changed files with 18 additions and 4 deletions

View File

@ -33,7 +33,7 @@ describe('Sidebar', () => {
describe('navigation Navbar', () => {
it('has seven b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(7)
expect(wrapper.findAll('.nav-item')).toHaveLength(8)
})
it('has first nav-item "navigation.overview" in navbar', () => {
@ -57,8 +57,11 @@ describe('Sidebar', () => {
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.admin_area')
})
it('has first nav-item "community.community" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('community.community')
})
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.logout')
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout')
})
})
})

View File

@ -50,7 +50,7 @@
import CONFIG from '@/config'
export default {
name: 'community',
name: 'Community',
data() {
return {
CONFIG,

View File

@ -50,7 +50,7 @@ describe('router', () => {
})
it('has sixteen routes defined', () => {
expect(routes).toHaveLength(16)
expect(routes).toHaveLength(17)
})
describe('overview', () => {
@ -97,6 +97,17 @@ describe('router', () => {
})
})
describe('community', () => {
it('requires authorization', () => {
expect(routes.find((r) => r.path === '/community').meta.requiresAuth).toBeTruthy()
})
it('loads the "Community" page', async () => {
const component = await routes.find((r) => r.path === '/community').component()
expect(component.default.name).toBe('Community')
})
})
describe('login', () => {
it('loads the "Login" page', async () => {
const component = await routes.find((r) => r.path === '/login/:code?').component()