mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
changes review, fix lint, fix locales, fix test
This commit is contained in:
parent
1c2155b7b8
commit
4ce456d459
@ -2,8 +2,7 @@
|
||||
"back": "Zurück",
|
||||
"community": {
|
||||
"choose-another-community": "Eine andere Gemeinschaft auswählen",
|
||||
"community": "Gemeinschaft",
|
||||
"communitys": {
|
||||
"communities": {
|
||||
"form": {
|
||||
"date_period": "Datum / Zeitraum",
|
||||
"hours": "Stunden",
|
||||
@ -12,8 +11,10 @@
|
||||
"submit": "Einreichen"
|
||||
}
|
||||
},
|
||||
"community": "Gemeinschaft",
|
||||
"continue-to-registration": "Weiter zur Registrierung",
|
||||
"current-community": "Aktuelle Gemeinschaft",
|
||||
"location": "Ort:",
|
||||
"other-communities": "Weitere Gemeinschaften",
|
||||
"switch-to-this-community": "zu dieser Gemeinschaft wechseln"
|
||||
},
|
||||
|
||||
@ -2,8 +2,7 @@
|
||||
"back": "Back",
|
||||
"community": {
|
||||
"choose-another-community": "Choose another community",
|
||||
"community": "Community",
|
||||
"communitys": {
|
||||
"communities": {
|
||||
"form": {
|
||||
"date_period": "Date / Period",
|
||||
"hours": "hours",
|
||||
@ -12,8 +11,10 @@
|
||||
"submit": "submit"
|
||||
}
|
||||
},
|
||||
"community": "Community",
|
||||
"continue-to-registration": "Continue to registration",
|
||||
"current-community": "Current community",
|
||||
"location": "Location:",
|
||||
"other-communities": "Other communities",
|
||||
"switch-to-this-community": "switch to this community"
|
||||
},
|
||||
|
||||
@ -49,7 +49,7 @@ const routes = [
|
||||
component: () => import('../views/Pages/ForgotPassword.vue'),
|
||||
},
|
||||
{
|
||||
path: '/regist-community',
|
||||
path: '/register-community',
|
||||
component: () => import('../views/Pages/RegisterCommunity.vue'),
|
||||
},
|
||||
{
|
||||
|
||||
@ -76,6 +76,18 @@ describe('Login', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Community Data', () => {
|
||||
it('has a Community name?', () => {
|
||||
expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung')
|
||||
})
|
||||
|
||||
it('has a Community description?', () => {
|
||||
expect(wrapper.find('.test-communitydata p').text()).toBe(
|
||||
'Die lokale Entwicklungsumgebung von Gradido.',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('links', () => {
|
||||
it('has a link "Forgot Password?"', () => {
|
||||
expect(wrapper.findAllComponents(RouterLinkStub).at(0).text()).toEqual(
|
||||
@ -94,7 +106,9 @@ describe('Login', () => {
|
||||
})
|
||||
|
||||
it('links to /register when clicking "Create new account"', () => {
|
||||
expect(wrapper.findAllComponents(RouterLinkStub).at(1).props().to).toBe('/regist-community')
|
||||
expect(wrapper.findAllComponents(RouterLinkStub).at(1).props().to).toBe(
|
||||
'/register-community',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<b-col lg="5" md="7">
|
||||
<b-card no-body class="border-0 mb-0" style="background-color: #ebebeba3 !important">
|
||||
<b-card-body class="p-4">
|
||||
<div class="text-center text-muted mb-4">
|
||||
<div class="text-center text-muted mb-4 test-communitydata">
|
||||
<b>{{ $store.state.community.name }}</b>
|
||||
<p class="text-lead">
|
||||
{{ $store.state.community.description }}
|
||||
@ -53,7 +53,7 @@
|
||||
class="text-center text-sm-right col-12 col-sm-6"
|
||||
v-show="allowRegister"
|
||||
>
|
||||
<router-link to="/regist-community" class="mt-3">
|
||||
<router-link to="/register-community" class="mt-3">
|
||||
{{ $t('site.login.new_wallet') }}
|
||||
</router-link>
|
||||
</b-col>
|
||||
|
||||
@ -59,6 +59,18 @@ describe('Register', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Community Data', () => {
|
||||
it('has a Community name?', () => {
|
||||
expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung')
|
||||
})
|
||||
|
||||
it('has a Community description?', () => {
|
||||
expect(wrapper.find('.test-communitydata p').text()).toBe(
|
||||
'Die lokale Entwicklungsumgebung von Gradido.',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('links', () => {
|
||||
it('has a link "Back"', () => {
|
||||
expect(wrapper.find('.test-button-back').text()).toEqual('back')
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<b-col lg="6" md="8">
|
||||
<b-card no-body class="border-0" style="background-color: #ebebeba3 !important">
|
||||
<b-card-body class="p-4">
|
||||
<div class="text-center text-muted mb-4">
|
||||
<div class="text-center text-muted mb-4 test-communitydata">
|
||||
<b>{{ $store.state.community.name }}</b>
|
||||
<p class="text-lead">
|
||||
{{ $store.state.community.description }}
|
||||
|
||||
@ -49,7 +49,7 @@ describe('RegisterCommunity', () => {
|
||||
|
||||
it('has a current community location', () => {
|
||||
expect(wrapper.find('.header p.community-location').text()).toBe(
|
||||
'Location: http://localhost:3000/vue/',
|
||||
'community.location http://localhost:3000/vue/',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@ -10,7 +10,9 @@
|
||||
<p class="text-lead">
|
||||
{{ $store.state.community.description }}
|
||||
</p>
|
||||
<p class="text-lead community-location">Location: {{ $store.state.community.url }}</p>
|
||||
<p class="text-lead community-location">
|
||||
{{ $t('community.location') }} {{ $store.state.community.url }}
|
||||
</p>
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import RegisterSelectCommunity from './RegisterSelectCommunity'
|
||||
// const testObject = require('../../../public/json-example/communities.json')
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
<b-container class="text-center">
|
||||
<div class="pb-3">{{ $t('community.current-community') }}</div>
|
||||
|
||||
<div v-for="community in communitys.community" :key="community.name">
|
||||
<div v-for="community in communities.community" :key="community.name">
|
||||
<b-card
|
||||
v-show="community.name === $store.state.community.name"
|
||||
v-if="community.name === $store.state.community.name"
|
||||
class="border-0 mb-0"
|
||||
bg-variant="primary"
|
||||
>
|
||||
@ -23,13 +23,13 @@
|
||||
|
||||
<div>{{ $t('community.other-communities') }}</div>
|
||||
|
||||
<div v-for="community in communitys.community" :key="community.id" class="pb-3">
|
||||
<b-card v-show="community.name != $store.state.community.name" bg-variant="secondary">
|
||||
<div v-for="community in communities.community" :key="community.id" class="pb-3">
|
||||
<b-card v-if="community.name != $store.state.community.name" bg-variant="secondary">
|
||||
<b>{{ community.name }}</b>
|
||||
<br />
|
||||
{{ community.description }}
|
||||
<br />
|
||||
Location:
|
||||
{{ $t('community.location') }}
|
||||
<b>
|
||||
<small>
|
||||
<b-link :href="community.url">{{ community.url }}</b-link>
|
||||
@ -49,13 +49,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import MyCommunitys from '../../../public/json-example/communitys.json'
|
||||
import MyCommunities from '../../../public/json-example/communities.json'
|
||||
|
||||
export default {
|
||||
name: 'registerSelectCommunity',
|
||||
data() {
|
||||
return {
|
||||
communitys: MyCommunitys,
|
||||
communities: MyCommunities,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
36
frontend/src/views/Pages/UserProfile/UserCard.spec.js
Normal file
36
frontend/src/views/Pages/UserProfile/UserCard.spec.js
Normal file
@ -0,0 +1,36 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import UserCard from './UserCard'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('UserCard', () => {
|
||||
let wrapper
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$n: jest.fn((n) => String(n)),
|
||||
$store: {
|
||||
state: {
|
||||
email: 'user@example.org',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(UserCard, { localVue, mocks })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the Div Element ".userdata-card"', () => {
|
||||
expect(wrapper.find('div.userdata-card').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('renders the Div Element "vue-qrcode"', () => {
|
||||
expect(wrapper.find('vue-qrcode'))
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -1,30 +1,32 @@
|
||||
<template>
|
||||
<b-card class="bg-transparent border-0">
|
||||
<div class="w-100 text-center">
|
||||
<vue-qrcode
|
||||
v-if="$store.state.email"
|
||||
:value="$store.state.email"
|
||||
type="image/png"
|
||||
></vue-qrcode>
|
||||
</div>
|
||||
<div class="userdata-card">
|
||||
<b-card class="bg-transparent border-0">
|
||||
<div class="w-100 text-center">
|
||||
<vue-qrcode
|
||||
v-if="$store.state.email"
|
||||
:value="$store.state.email"
|
||||
type="image/png"
|
||||
></vue-qrcode>
|
||||
</div>
|
||||
|
||||
<div class="card-profile-stats d-flex justify-content-center mt-md-5">
|
||||
<div>
|
||||
<span class="heading">
|
||||
{{ $n(balance, 'decimal') }}
|
||||
</span>
|
||||
<span class="description">GDD</span>
|
||||
<div class="card-profile-stats d-flex justify-content-center mt-md-5">
|
||||
<div>
|
||||
<span class="heading">
|
||||
{{ $n(balance, 'decimal') }}
|
||||
</span>
|
||||
<span class="description">GDD</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="heading">{{ transactionCount }}</span>
|
||||
<span class="description">{{ $t('transactions') }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="heading">--</span>
|
||||
<span class="description">{{ $t('community.community') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="heading">{{ transactionCount }}</span>
|
||||
<span class="description">{{ $t('transactions') }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="heading">--</span>
|
||||
<span class="description">{{ $t('community.community') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</b-card>
|
||||
</b-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import VueQrcode from 'vue-qrcode'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user