mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove elopage links and methods
This commit is contained in:
parent
cd4fc51629
commit
8223fdd42b
@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -74,10 +74,6 @@
|
||||
{{ $t('navigation.info') }}
|
||||
</b-nav-item>
|
||||
<br />
|
||||
<b-nav-item v-if="$store.state.hasElopage" :href="elopageUri" class="mb-3" target="_blank">
|
||||
<b-icon icon="link45deg" aria-hidden="true"></b-icon>
|
||||
{{ $t('navigation.members_area') }}
|
||||
</b-nav-item>
|
||||
<b-nav-item class="mb-3" v-if="$store.state.isAdmin" @click="$emit('admin')">
|
||||
<b-icon icon="shield-check" aria-hidden="true"></b-icon>
|
||||
{{ $t('navigation.admin_area') }}
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -35,15 +35,6 @@
|
||||
</b-nav>
|
||||
<hr />
|
||||
<b-nav vertical class="w-100">
|
||||
<b-nav-item
|
||||
v-if="$store.state.hasElopage"
|
||||
class="mb-3"
|
||||
:href="elopageUri"
|
||||
target="_blank"
|
||||
>
|
||||
<b-icon icon="link45deg" aria-hidden="true"></b-icon>
|
||||
{{ $t('navigation.members_area') }}
|
||||
</b-nav-item>
|
||||
<b-nav-item class="mb-3" v-if="$store.state.isAdmin" @click="$emit('admin')">
|
||||
<b-icon icon="shield-check" aria-hidden="true"></b-icon>
|
||||
{{ $t('navigation.admin_area') }}
|
||||
|
||||
@ -44,13 +44,6 @@
|
||||
<b-icon icon="gear" aria-hidden="true"></b-icon>
|
||||
<span class="d-none d-lg-inline ml-2">{{ $t('navigation.settings') }}</span>
|
||||
</b-nav-item>
|
||||
<b-nav-item class="mb-3" :href="elopageUri" target="_blank">
|
||||
<b-icon icon="link45deg" aria-hidden="true"></b-icon>
|
||||
<span class="d-none d-lg-inline ml-2 mr-2">{{ $t('navigation.members_area') }}</span>
|
||||
<b-badge v-if="!$store.state.hasElopage" pill variant="danger">
|
||||
{{ $t('math.exclaim') }}
|
||||
</b-badge>
|
||||
</b-nav-item>
|
||||
<b-nav-item class="mb-3" v-if="$store.state.isAdmin" @click="$emit('admin')">
|
||||
<b-icon icon="shield-check" aria-hidden="true"></b-icon>
|
||||
<span class="d-none d-lg-inline ml-2">{{ $t('navigation.admin_area') }}</span>
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="bg-default">
|
||||
<div class="main-page bg-default">
|
||||
<div class="position-absolute w-100 h-100 bg-default">
|
||||
<!--<navbar
|
||||
class="main-navbar"
|
||||
@ -194,16 +194,16 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
elopageUri() {
|
||||
const pId = this.$store.state.publisherId
|
||||
? this.$store.state.publisherId
|
||||
: CONFIG.DEFAULT_PUBLISHER_ID
|
||||
return encodeURI(
|
||||
this.$store.state.hasElopage
|
||||
? `https://elopage.com/s/gradido/sign_in?locale=${this.$i18n.locale}`
|
||||
: `https://elopage.com/s/gradido/basic-de/payment?locale=${this.$i18n.locale}&prid=111&pid=${pId}&firstName=${this.$store.state.firstName}&lastName=${this.$store.state.lastName}&email=${this.$store.state.email}`,
|
||||
)
|
||||
},
|
||||
// elopageUri() {
|
||||
// const pId = this.$store.state.publisherId
|
||||
// ? this.$store.state.publisherId
|
||||
// : CONFIG.DEFAULT_PUBLISHER_ID
|
||||
// return encodeURI(
|
||||
// this.$store.state.hasElopage
|
||||
// ? `https://elopage.com/s/gradido/sign_in?locale=${this.$i18n.locale}`
|
||||
// : `https://elopage.com/s/gradido/basic-de/payment?locale=${this.$i18n.locale}&prid=111&pid=${pId}&firstName=${this.$store.state.firstName}&lastName=${this.$store.state.lastName}&email=${this.$store.state.email}`,
|
||||
// )
|
||||
// },
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user