test no transactions, test transaction is empty

This commit is contained in:
ogerly 2021-12-14 09:44:52 +01:00
parent 0818ddcf66
commit 4cfd2206fe
2 changed files with 25 additions and 3 deletions

View File

@ -36,9 +36,31 @@ describe('GddTransactionList', () => {
expect(wrapper.find('div.gdd-transaction-list').exists()).toBeTruthy()
})
describe('Prüfen wenn keine Transaktionen vom Server kommen', () => {
beforeEach(async () => {
await wrapper.setProps({
transactions: false,
})
})
it('transactions array ist nicht da', () => {
expect(wrapper.find('div.test-no-transactionlist').text()).toBe('error.no-transactionlist')
})
})
describe('Prüfen wenn 0 Transaktionen vom Server kommen', () => {
beforeEach(async () => {
await wrapper.setProps({
transactions: [],
transactionCount: 0,
})
})
it('transactions ist leer, 0 Transaktionen', () => {
expect(wrapper.find('div.test-empty-transactionlist').text()).toBe('error.empty-transactionlist')
})
})
describe('without any properties', () => {
it('renders text saying that there are no transactions', () => {
expect(wrapper.find('div.gdd-transaction-list').text()).toBe(
expect(wrapper.find('div.gdd-transaction-list').text()).toContain(
'error.empty-transactionlist transaction.nullTransactions',
)
})

View File

@ -1,13 +1,13 @@
<template>
<div class="gdd-transaction-list">
<div class="list-group">
<div v-if="!transactions" class="text-right">
<div v-if="!transactions" class="test-no-transactionlist text-right">
<b-icon icon="exclamation-triangle" class="mr-2" style="color: red"></b-icon>
<small>
{{ $t('error.no-transactionlist') }}
</small>
</div>
<div v-if="!transactionCount" class="text-right">
<div v-if="!transactionCount" class="test-empty-transactionlist text-right">
<b-icon icon="exclamation-triangle" class="mr-2" style="color: red"></b-icon>
<small>{{ $t('error.empty-transactionlist') }}</small>
</div>