diff --git a/frontend/src/components/Menu/Navbar.spec.js b/frontend/src/components/Menu/Navbar.spec.js index 3f12682c0..df422bea2 100644 --- a/frontend/src/components/Menu/Navbar.spec.js +++ b/frontend/src/components/Menu/Navbar.spec.js @@ -49,7 +49,7 @@ describe('Navbar', () => { }) it('has ten b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(11) + expect(wrapper.findAll('.nav-item')).toHaveLength(12) }) it('has first nav-item "amount GDD" in navbar', () => { @@ -75,22 +75,26 @@ describe('Navbar', () => { it('has first nav-item "navigation.profile" in navbar', () => { expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.profile') }) + + it('has first nav-item "navigation.info" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.info') + }) }) describe('navigation Navbar (user has an elopage account)', () => { it('has a link to the members area', () => { - expect(wrapper.findAll('.nav-item').at(8).text()).toContain('navigation.members_area') - expect(wrapper.findAll('.nav-item').at(8).find('a').attributes('href')).toBe( + expect(wrapper.findAll('.nav-item').at(9).text()).toContain('navigation.members_area') + expect(wrapper.findAll('.nav-item').at(9).find('a').attributes('href')).toBe( 'https://elopage.com', ) }) it('has first nav-item "navigation.admin_area" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.admin_area') + expect(wrapper.findAll('.nav-item').at(10).text()).toEqual('navigation.admin_area') }) it('has first nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(10).text()).toEqual('navigation.logout') + expect(wrapper.findAll('.nav-item').at(11).text()).toEqual('navigation.logout') }) }) @@ -101,11 +105,11 @@ describe('Navbar', () => { }) it('has first nav-item "navigation.admin_area" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.admin_area') + expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.admin_area') }) it('has first nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.logout') + expect(wrapper.findAll('.nav-item').at(10).text()).toEqual('navigation.logout') }) }) }) diff --git a/frontend/src/components/Menu/Navbar.vue b/frontend/src/components/Menu/Navbar.vue index ef222fdb4..fa02e2aaf 100644 --- a/frontend/src/components/Menu/Navbar.vue +++ b/frontend/src/components/Menu/Navbar.vue @@ -60,6 +60,10 @@ {{ $t('navigation.profile') }} + + + {{ $t('navigation.info') }} +
diff --git a/frontend/src/components/Menu/Sidebar.spec.js b/frontend/src/components/Menu/Sidebar.spec.js index c1f8c8fc7..873fa25b0 100644 --- a/frontend/src/components/Menu/Sidebar.spec.js +++ b/frontend/src/components/Menu/Sidebar.spec.js @@ -33,8 +33,8 @@ describe('Sidebar', () => { }) describe('navigation Navbar', () => { - it('has seven b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(8) + it('has nine b-nav-item in the navbar', () => { + expect(wrapper.findAll('.nav-item')).toHaveLength(9) }) describe('navigation Navbar (general elements)', () => { @@ -58,21 +58,40 @@ describe('Sidebar', () => { expect(wrapper.findAll('.nav-item').at(4).text()).toEqual('navigation.profile') }) - it('has first nav-item "navigation.profile" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.profile') + it('has first nav-item "navigation.info" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.info') }) }) describe('navigation Navbar (user has an elopage account)', () => { + it('has nine b-nav-item in the navbar', () => { + expect(wrapper.findAll('.nav-item')).toHaveLength(9) + }) + + it('has a link to the members area', () => { + expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.members_area') + expect(wrapper.findAll('.nav-item').at(6).find('a').attributes('href')).toBe('#') + }) + + it('has first nav-item "navigation.admin_area" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.admin_area') + }) + + it('has first nav-item "navigation.logout" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.logout') + }) + }) + + describe('navigation Navbar (user has no elopage account)', () => { + beforeAll(() => { + mocks.$store.state.hasElopage = false + wrapper = Wrapper() + }) + it('has eight b-nav-item in the navbar', () => { expect(wrapper.findAll('.nav-item')).toHaveLength(8) }) - it('has a link to the members area', () => { - expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.members_area') - expect(wrapper.findAll('.nav-item').at(5).find('a').attributes('href')).toBe('#') - }) - it('has first nav-item "navigation.admin_area" in navbar', () => { expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area') }) @@ -88,21 +107,8 @@ describe('Sidebar', () => { wrapper = Wrapper() }) - it('has seven b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(7) - }) - - 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 a link to the members area', () => { - expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.members_area') - expect(wrapper.findAll('.nav-item').at(5).find('a').attributes('href')).toBe('#') + it('has eight b-nav-item in the navbar', () => { + expect(wrapper.findAll('.nav-item')).toHaveLength(8) }) it('has first nav-item "navigation.admin_area" in navbar', () => { @@ -113,29 +119,6 @@ describe('Sidebar', () => { expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout') }) }) - - describe('navigation Navbar (user has no elopage account)', () => { - beforeAll(() => { - mocks.$store.state.hasElopage = false - wrapper = Wrapper() - }) - - it('has seven b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(7) - }) - - 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(7).text()).toEqual('navigation.logout') - }) - }) }) }) }) diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index deeecb564..594748276 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -44,10 +44,6 @@ {{ $t('navigation.admin_area') }} - - - {{ $t('community.community') }} - {{ $t('navigation.logout') }} diff --git a/frontend/src/routes/router.test.js b/frontend/src/routes/router.test.js index c843f85bb..2297506ae 100644 --- a/frontend/src/routes/router.test.js +++ b/frontend/src/routes/router.test.js @@ -50,7 +50,7 @@ describe('router', () => { }) it('has sixteen routes defined', () => { - expect(routes).toHaveLength(17) + expect(routes).toHaveLength(18) }) describe('overview', () => { @@ -119,6 +119,17 @@ describe('router', () => { }) }) + describe('info', () => { + it('requires authorization', () => { + expect(routes.find((r) => r.path === '/info').meta.requiresAuth).toBeTruthy() + }) + + it('loads the "InfoStatistic" page', async () => { + const component = await routes.find((r) => r.path === '/info').component() + expect(component.default.name).toBe('InfoStatistic') + }) + }) + describe('login', () => { it('loads the "Login" page', async () => { const component = await routes.find((r) => r.path === '/login/:code?').component()