mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove the member area entry from navbar menu and adjust the unit tests accordingly
This commit is contained in:
parent
2c07ec98ab
commit
a01c5a4b3f
@ -17,7 +17,7 @@ const mocks = {
|
|||||||
$t: jest.fn((t) => t),
|
$t: jest.fn((t) => t),
|
||||||
$store: {
|
$store: {
|
||||||
state: {
|
state: {
|
||||||
hasElopage: false,
|
hasElopage: true,
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -39,7 +39,7 @@ describe('Navbar', () => {
|
|||||||
expect(wrapper.find('div.component-navbar').exists()).toBeTruthy()
|
expect(wrapper.find('div.component-navbar').exists()).toBeTruthy()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('navigation Navbar', () => {
|
describe('navigation Navbar (general elements)', () => {
|
||||||
it('has .navbar-brand in the navbar', () => {
|
it('has .navbar-brand in the navbar', () => {
|
||||||
expect(wrapper.find('.navbar-brand').exists()).toBeTruthy()
|
expect(wrapper.find('.navbar-brand').exists()).toBeTruthy()
|
||||||
})
|
})
|
||||||
@ -66,7 +66,8 @@ describe('Navbar', () => {
|
|||||||
it('has first nav-item "navigation.profile" in navbar', () => {
|
it('has first nav-item "navigation.profile" in navbar', () => {
|
||||||
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.profile')
|
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.profile')
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
describe('navigation Navbar (user has an elopage account)', () => {
|
||||||
it('has a link to the members area', () => {
|
it('has a link to the members area', () => {
|
||||||
expect(wrapper.findAll('.nav-item').at(7).text()).toContain('navigation.members_area')
|
expect(wrapper.findAll('.nav-item').at(7).text()).toContain('navigation.members_area')
|
||||||
expect(wrapper.findAll('.nav-item').at(7).find('a').attributes('href')).toBe(
|
expect(wrapper.findAll('.nav-item').at(7).find('a').attributes('href')).toBe(
|
||||||
@ -81,6 +82,18 @@ describe('Navbar', () => {
|
|||||||
expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.logout')
|
expect(wrapper.findAll('.nav-item').at(9).text()).toEqual('navigation.logout')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
describe('navigation Navbar (user has no elopage account)', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
mocks.$store.state.hasElopage = false
|
||||||
|
wrapper = Wrapper()
|
||||||
|
})
|
||||||
|
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('check watch visible true', () => {
|
describe('check watch visible true', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
|||||||
@ -57,12 +57,9 @@
|
|||||||
{{ $t('navigation.profile') }}
|
{{ $t('navigation.profile') }}
|
||||||
</b-nav-item>
|
</b-nav-item>
|
||||||
<br />
|
<br />
|
||||||
<b-nav-item :href="elopageUri" class="mb-3" target="_blank">
|
<b-nav-item v-if="$store.state.hasElopage" :href="elopageUri" class="mb-3" target="_blank">
|
||||||
<b-icon icon="link45deg" aria-hidden="true"></b-icon>
|
<b-icon icon="link45deg" aria-hidden="true"></b-icon>
|
||||||
{{ $t('navigation.members_area') }}
|
{{ $t('navigation.members_area') }}
|
||||||
<b-badge v-if="!$store.state.hasElopage" pill variant="danger">
|
|
||||||
{{ $t('math.exclaim') }}
|
|
||||||
</b-badge>
|
|
||||||
</b-nav-item>
|
</b-nav-item>
|
||||||
<b-nav-item class="mb-3" v-if="$store.state.isAdmin" @click="$emit('admin')">
|
<b-nav-item class="mb-3" v-if="$store.state.isAdmin" @click="$emit('admin')">
|
||||||
<b-icon icon="shield-check" aria-hidden="true"></b-icon>
|
<b-icon icon="shield-check" aria-hidden="true"></b-icon>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user