From 8223fdd42b07eb9a31e6974e74a47caba8b1c5d9 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 24 Oct 2022 12:00:39 +0200 Subject: [PATCH] remove elopage links and methods --- frontend/src/components/Menu/Navbar.spec.js | 15 +-- frontend/src/components/Menu/Navbar.vue | 4 - frontend/src/components/Menu/Sidebar.spec.js | 21 ++-- frontend/src/components/Menu/Sidebar.vue | 9 -- frontend/src/components/Menu/SidebarNew.vue | 7 -- frontend/src/layouts/DashboardLayout.spec.js | 100 +++++++++---------- frontend/src/layouts/DashboardLayout.vue | 22 ++-- 7 files changed, 73 insertions(+), 105 deletions(-) diff --git a/frontend/src/components/Menu/Navbar.spec.js b/frontend/src/components/Menu/Navbar.spec.js index 1e08ad9dc..0427f67ee 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 thirteen b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(13) + expect(wrapper.findAll('.nav-item')).toHaveLength(12) }) it('has nav-item "amount GDD" in navbar', () => { @@ -85,20 +85,13 @@ describe('Navbar', () => { }) }) - describe('navigation Navbar (user has an elopage account)', () => { - it('has a link to the members area', () => { - expect(wrapper.findAll('.nav-item').at(10).text()).toContain('navigation.members_area') - expect(wrapper.findAll('.nav-item').at(10).find('a').attributes('href')).toBe( - 'https://elopage.com', - ) - }) - + describe('navigation Navbar', () => { it('has nav-item "navigation.admin_area" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(11).text()).toEqual('navigation.admin_area') + expect(wrapper.findAll('.nav-item').at(10).text()).toEqual('navigation.admin_area') }) it('has nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(12).text()).toEqual('navigation.logout') + expect(wrapper.findAll('.nav-item').at(11).text()).toEqual('navigation.logout') }) }) diff --git a/frontend/src/components/Menu/Navbar.vue b/frontend/src/components/Menu/Navbar.vue index 8727dbd2f..3acc043ac 100644 --- a/frontend/src/components/Menu/Navbar.vue +++ b/frontend/src/components/Menu/Navbar.vue @@ -74,10 +74,6 @@ {{ $t('navigation.info') }}
- - - {{ $t('navigation.members_area') }} - {{ $t('navigation.admin_area') }} diff --git a/frontend/src/components/Menu/Sidebar.spec.js b/frontend/src/components/Menu/Sidebar.spec.js index 612649762..09314c098 100644 --- a/frontend/src/components/Menu/Sidebar.spec.js +++ b/frontend/src/components/Menu/Sidebar.spec.js @@ -34,7 +34,7 @@ describe('Sidebar', () => { describe('navigation Navbar', () => { it('has ten b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(10) + expect(wrapper.findAll('.nav-item')).toHaveLength(9) }) describe('navigation Navbar (general elements)', () => { @@ -63,35 +63,30 @@ describe('Sidebar', () => { }) }) - describe('navigation Navbar (user has an elopage account)', () => { + describe('navigation Navbar', () => { it('has ten b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(10) - }) - - it('has a link to the members area', () => { - expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.members_area') - expect(wrapper.findAll('.nav-item').at(7).find('a').attributes('href')).toBe('#') + expect(wrapper.findAll('.nav-item')).toHaveLength(9) }) it('has 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(7).text()).toEqual('navigation.admin_area') }) it('has nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.logout') + expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.logout') }) }) it('has 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(7).text()).toEqual('navigation.admin_area') }) it('has nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.logout') + expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.logout') }) }) - describe('navigation Navbar (user has no elopage account)', () => { + describe('navigation Navbar', () => { beforeAll(() => { mocks.$store.state.hasElopage = false wrapper = Wrapper() diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index f6abb6fbc..1d0925b34 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -35,15 +35,6 @@
- - - {{ $t('navigation.members_area') }} - {{ $t('navigation.admin_area') }} diff --git a/frontend/src/components/Menu/SidebarNew.vue b/frontend/src/components/Menu/SidebarNew.vue index 6d2fe15da..3f6a5ef47 100644 --- a/frontend/src/components/Menu/SidebarNew.vue +++ b/frontend/src/components/Menu/SidebarNew.vue @@ -44,13 +44,6 @@ {{ $t('navigation.settings') }} - - - {{ $t('navigation.members_area') }} - - {{ $t('math.exclaim') }} - - {{ $t('navigation.admin_area') }} diff --git a/frontend/src/layouts/DashboardLayout.spec.js b/frontend/src/layouts/DashboardLayout.spec.js index 846974781..6bf845596 100644 --- a/frontend/src/layouts/DashboardLayout.spec.js +++ b/frontend/src/layouts/DashboardLayout.spec.js @@ -221,64 +221,64 @@ describe('DashboardLayout', () => { }) }) - describe('set visible method', () => { - beforeEach(() => { - wrapper.findComponent({ name: 'Navbar' }).vm.$emit('set-visible', true) - }) + // describe('set visible method', () => { + // beforeEach(() => { + // wrapper.findComponent({ name: 'NavbarNew' }).vm.$emit('set-visible', true) + // }) - it('sets visible to true', () => { - expect(wrapper.vm.visible).toBe(true) - }) - }) + // it('sets visible to true', () => { + // expect(wrapper.vm.visible).toBe(true) + // }) + // }) - describe('elopage URI', () => { - describe('user has no publisher ID and no elopage', () => { - beforeEach(() => { - mocks.$store.state.publisherId = null - mocks.$store.state.hasElopage = false - wrapper = Wrapper() - }) + // describe('elopage URI', () => { + // describe('user has no publisher ID and no elopage', () => { + // beforeEach(() => { + // mocks.$store.state.publisherId = null + // mocks.$store.state.hasElopage = false + // wrapper = Wrapper() + // }) - it('links to basic-de', () => { - expect(wrapper.vm.elopageUri).toBe( - 'https://elopage.com/s/gradido/basic-de/payment?locale=en&prid=111&pid=2896&firstName=User&lastName=Example&email=user@example.org', - ) - }) - }) + // it('links to basic-de', () => { + // expect(wrapper.vm.elopageUri).toBe( + // 'https://elopage.com/s/gradido/basic-de/payment?locale=en&prid=111&pid=2896&firstName=User&lastName=Example&email=user@example.org', + // ) + // }) + // }) - describe('user has elopage', () => { - beforeEach(() => { - mocks.$store.state.publisherId = '123' - mocks.$store.state.hasElopage = true - wrapper = Wrapper() - }) + // describe('user has elopage', () => { + // beforeEach(() => { + // mocks.$store.state.publisherId = '123' + // mocks.$store.state.hasElopage = true + // wrapper = Wrapper() + // }) - it('links to sign in for elopage', () => { - expect(wrapper.vm.elopageUri).toBe('https://elopage.com/s/gradido/sign_in?locale=en') - }) - }) - }) + // it('links to sign in for elopage', () => { + // expect(wrapper.vm.elopageUri).toBe('https://elopage.com/s/gradido/sign_in?locale=en') + // }) + // }) + // }) - describe('admin method', () => { - const windowLocationMock = jest.fn() - beforeEach(() => { - delete window.location - window.location = { - assign: windowLocationMock, - } - wrapper.findComponent({ name: 'Navbar' }).vm.$emit('admin') - }) + // describe('admin method', () => { + // const windowLocationMock = jest.fn() + // beforeEach(() => { + // delete window.location + // window.location = { + // assign: windowLocationMock, + // } + // wrapper.findComponent({ name: 'NavbarNew' }).vm.$emit('admin') + // }) - it('dispatches logout to store', () => { - expect(storeDispatchMock).toBeCalled() - }) + // it('dispatches logout to store', () => { + // expect(storeDispatchMock).toBeCalled() + // }) - it('changes window location to admin interface', () => { - expect(windowLocationMock).toBeCalledWith( - 'http://localhost/admin/authenticate?token=valid-token', - ) - }) - }) + // it('changes window location to admin interface', () => { + // expect(windowLocationMock).toBeCalledWith( + // 'http://localhost/admin/authenticate?token=valid-token', + // ) + // }) + // }) }) describe('set tunneled email', () => { diff --git a/frontend/src/layouts/DashboardLayout.vue b/frontend/src/layouts/DashboardLayout.vue index 5af91dc32..4977c6d92 100755 --- a/frontend/src/layouts/DashboardLayout.vue +++ b/frontend/src/layouts/DashboardLayout.vue @@ -1,5 +1,5 @@