change review comments, fix lint, fix test

This commit is contained in:
ogerly 2021-07-17 09:58:22 +02:00
parent 61272a7f7d
commit dcc933ca3a
5 changed files with 44 additions and 38 deletions

View File

@ -8,11 +8,10 @@
<b-list-group style="border: 0px">
<b-list-group-item style="border: 0px; background-color: #f1f1f1">
<div class="d-flex">
<div style="width: 40%" class="text-right pr-3 mr-2">
{{ $t('decay.calculation_decay') }}
<div style="width: 100%" class="text-center pb-3">
<b-icon icon="droplet-half" height="12" class="mb-2" />
{{ $t('decay.calculation_decay') }}
</div>
<div style="width: 60%"></div>
</div>
<div class="d-flex">

View File

@ -35,7 +35,8 @@
"seconds":"Sekunden",
"received":"empfangen",
"sent":"gesendet",
"created":"geschöpft"
"created":"geschöpft",
"fromCommunity":"Aus der Community"
},
"form": {
"cancel": "Abbrechen",

View File

@ -8,7 +8,7 @@
"reset": "Reset password",
"imprint":"Legal notice",
"privacy_policy":"Privacy policy",
"members_area": "Members area",
"members_area": "Member´s area",
"whitepaper": "Whitepaper",
"back":"Back",
"send":"Send",
@ -35,7 +35,8 @@
"seconds": "Seconds",
"received":"received",
"sent":"sent",
"created":"created"
"created":"reated",
"fromCommunity":"From the community"
},
"form": {
"cancel":"Cancel",

View File

@ -19,7 +19,7 @@ describe('GddTransactionList', () => {
$t: jest.fn((t) => t),
$d: jest.fn((d) => d),
$i18n: {
locale: () => 'en',
locale: () => 'de',
},
}
@ -60,6 +60,7 @@ describe('GddTransactionList', () => {
name: 'Bob der Baumeister',
transaction_id: 29,
type: 'send',
decay: { balance: '0.5' },
},
{
balance: '1000',
@ -76,6 +77,7 @@ describe('GddTransactionList', () => {
name: 'Jan Ulrich',
transaction_id: 8,
type: 'receive',
decay: { balance: '1.5' },
},
{
balance: '1.07',
@ -113,11 +115,21 @@ describe('GddTransactionList', () => {
})
it('shows the name of the receiver', () => {
expect(transaction.findAll('div').at(3).text()).toContain('Bob der Baumeister')
expect(transaction.findAll('div').at(0).text()).toContain('Bob der Baumeister')
})
it('shows the memo of the receiver', () => {
expect(transaction.findAll('div').at(5).text()).toContain('Alles Gute zum Geburtstag')
})
it('shows the date of the transaction', () => {
expect(transaction.findAll('div').at(3).text()).toContain('Tue May 25 2021')
expect(transaction.findAll('div').at(8).text()).toContain(
'Tue May 25 2021 19:38:13 GMT+0200',
)
})
it('shows the decay calculation', () => {
expect(transaction.findAll('div').at(9).text()).toContain('-0.5')
})
})
@ -167,19 +179,25 @@ describe('GddTransactionList', () => {
})
it('shows the amount of transaction', () => {
expect(transaction.findAll('div').at(2).text()).toContain('314.98')
})
it('has a plus operator', () => {
expect(transaction.findAll('div').at(2).text()).toContain('+')
expect(transaction.findAll('div').at(2).text()).toContain('+ 314.98')
})
it('shows the name of the receiver', () => {
expect(transaction.findAll('div').at(3).text()).toContain('Jan Ulrich')
expect(transaction.findAll('div').at(0).text()).toContain('Jan Ulrich')
})
it('shows the memo of the receiver', () => {
expect(transaction.findAll('div').at(5).text()).toContain('Für das Fahrrad!')
})
it('shows the date of the transaction', () => {
expect(transaction.findAll('div').at(3).text()).toContain('Thu Apr 29 2021')
expect(transaction.findAll('div').at(8).text()).toContain(
'Thu Apr 29 2021 19:26:40 GMT+0200',
)
})
it('shows the decay calculation', () => {
expect(transaction.findAll('div').at(9).text()).toContain('-1.5')
})
})

View File

@ -9,19 +9,19 @@
<!-- ROW Start -->
<div class="d-flex gdd-transaction-list-item" v-b-toggle="'a' + date + ''">
<!-- ICON -->
<div class="tap1" style="width: 8%">
<div style="width: 8%">
<b-icon :icon="getProperties(type).icon" :class="getProperties(type).class" />
</div>
<!-- Text Links -->
<div class="font1_2em pr-2 text-right tap2" style="width: 32%">
<div class="font1_2em pr-2 text-right" style="width: 32%">
<span>{{ getProperties(type).operator }}</span>
<small v-if="type === 'decay'">{{ $n(balance, 'decimal') }}</small>
<span v-else>{{ $n(balance, 'decimal') }}</span>
<div>
<div v-if="type !== 'decay' && type !== 'creation'">
<small>
{{ $t('form.message') }}
{{ $t('form.memo') }}
</small>
</div>
<div v-if="decay">
@ -30,8 +30,8 @@
</div>
</div>
<!-- Text Rechts -->
<div class="font1_2em text-left pl-2 tap3" style="width: 55%">
{{ name ? name : '' }}
<div class="font1_2em text-left pl-2" style="width: 55%">
<div>{{ name ? name : '' }}</div>
<div>
<small>
{{ memo }}
@ -46,7 +46,7 @@
<decay-information v-if="decay" decaytyp="short" :decay="decay" />
</div>
<!-- Collaps Toggle Button -->
<div v-if="type != 'decay'" class="text-right tap4" style="width: 5%">
<div v-if="type != 'decay'" class="text-right" style="width: 5%">
<b-button class="btn-sm">
<b>i</b>
</b-button>
@ -55,24 +55,11 @@
<!-- ROW End -->
<!-- Collaps Start -->
<b-collapse v-if="type != 'decay'" :id="'a' + date + ''">
<b-list-group v-if="type === 'receive' || type === 'send'">
<b-list-group-item style="border: 0px; background-color: #f1f1f1">
<div class="d-flex">
<div style="width: 40%" class="text-right pr-3 mr-2">
{{ type === 'receive' ? $t('form.from') : $t('form.to1') }}:
</div>
<div style="width: 60%">
{{ name }}
<b-avatar class="mr-3"></b-avatar>
</div>
</div>
</b-list-group-item>
</b-list-group>
<b-list-group v-if="type === 'creation'">
<b-list-group-item style="border: 0px">
<div class="d-flex">
<div style="width: 40%" class="text-right pr-3 mr-2">Schöpfung</div>
<div style="width: 60%">Aus der Community</div>
<div style="width: 40%" class="text-right pr-3 mr-2">{{ $t('decay.created') }}</div>
<div style="width: 60%">{{ $t('decay.fromCommunity') }}</div>
</div>
</b-list-group-item>
</b-list-group>