Merge pull request #1259 from gradido/1226-Text-nach-erster-Anmeldung-entfernen

transactionCount false or transactionCount error text hide
This commit is contained in:
Hannes Heine 2022-01-15 13:25:52 +01:00 committed by GitHub
commit 4cadbf0f69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -100,6 +100,7 @@ export default {
}) })
.catch((error) => { .catch((error) => {
this.pending = true this.pending = true
this.transactionCount = -1
this.$toasted.global.error(error.message) this.$toasted.global.error(error.message)
// what to do when loading balance fails? // what to do when loading balance fails?
}) })

View File

@ -56,16 +56,20 @@ describe('GddTransactionList', () => {
}) })
}) })
it('Transactions Array is empty, 0 transactions', () => { it('Transactions Array is empty, 0 transactions', () => {
expect(wrapper.find('div.test-empty-transactionlist').text()).toContain( expect(wrapper.find('div.test-empty-transactionlist').exists()).toBe(false)
'error.empty-transactionlist',
)
}) })
}) })
describe('without any properties', () => { describe('without any properties', () => {
beforeEach(async () => {
await wrapper.setProps({
transactions: [],
transactionCount: -1,
})
})
it('renders text saying that there are error.empty-transactionlist ', () => { it('renders text saying that there are error.empty-transactionlist ', () => {
expect(wrapper.find('div.gdd-transaction-list').text()).toContain( expect(wrapper.find('div.gdd-transaction-list').text()).toContain(
'error.empty-transactionlist', 'transaction.nullTransactions',
) )
}) })
it('renders text saying that there are no transaction.nullTransactions', () => { it('renders text saying that there are no transaction.nullTransactions', () => {

View File

@ -7,7 +7,7 @@
{{ $t('error.no-transactionlist') }} {{ $t('error.no-transactionlist') }}
</small> </small>
</div> </div>
<div v-if="!transactionCount" class="test-empty-transactionlist text-right"> <div v-if="transactionCount < 0" class="test-empty-transactionlist text-right">
<b-icon icon="exclamation-triangle" class="mr-2" style="color: red"></b-icon> <b-icon icon="exclamation-triangle" class="mr-2" style="color: red"></b-icon>
<small>{{ $t('error.empty-transactionlist') }}</small> <small>{{ $t('error.empty-transactionlist') }}</small>
</div> </div>
@ -134,7 +134,7 @@
:per-page="pageSize" :per-page="pageSize"
:total-rows="transactionCount" :total-rows="transactionCount"
></pagination-buttons> ></pagination-buttons>
<div v-if="transactionCount === 0" class="mt-4 text-center"> <div v-if="transactionCount < 0" class="mt-4 text-center">
<span>{{ $t('transaction.nullTransactions') }}</span> <span>{{ $t('transaction.nullTransactions') }}</span>
</div> </div>
</div> </div>