Tests pass

This commit is contained in:
Robert Schäfer 2019-03-15 16:56:24 +01:00
parent 3fad432858
commit e6af5a11ab
2 changed files with 21 additions and 8 deletions

View File

@ -1,4 +1,4 @@
import { config, mount, createLocalVue } from '@vue/test-utils'
import { config, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
import User from './User.vue'
import Vue from 'vue'
import Vuex from 'vuex'
@ -30,7 +30,9 @@ describe('User.vue', () => {
mocks = {
$t: jest.fn()
}
stubs = ['router-link', 'router-view']
stubs = {
NuxtLink: RouterLinkStub
}
getters = {
'auth/user': () => {
return {}
@ -71,7 +73,6 @@ describe('User.vue', () => {
beforeEach(() => {
propsData.user.disabled = true
})
})
})
})

View File

@ -1,5 +1,22 @@
<template>
<div v-if="!user">
<div style="display: inline-block; float: left; margin-right: 4px; height: 100%; vertical-align: middle;">
<ds-avatar
style="display: inline-block; vertical-align: middle;"
size="32px"
/>
</div>
<div style="display: inline-block; height: 100%; vertical-align: middle;">
<b
class="username"
style="vertical-align: middle;"
>
Anonymus
</b>
</div>
</div>
<dropdown
v-else
:disabled="disabled || !showUserPopover"
placement="top-start"
offset="0"
@ -87,11 +104,6 @@
</ds-space>
</ds-flex-item>
</ds-flex>
<!--<ds-text
color="soft"
size="small">
<ds-icon name="map-marker" /> Hamburg, Deutschland
</ds-text>-->
<ds-flex
v-if="!itsMe"
gutter="x-small"