From 151f497252b9f6bda4f16a18b4e464a21e38fa7f Mon Sep 17 00:00:00 2001 From: elweyn Date: Fri, 14 Jan 2022 08:47:07 +0100 Subject: [PATCH] Changed the logic of no transactions, sets -1 if error was thrown so that we dont have the error if no transactions are present. --- frontend/src/views/Layout/DashboardLayout_gdd.vue | 1 + .../views/Pages/AccountOverview/GddTransactionList.spec.js | 6 ++++++ .../src/views/Pages/AccountOverview/GddTransactionList.vue | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index bd3bd8e4c..40a6011d5 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -100,6 +100,7 @@ export default { }) .catch((error) => { this.pending = true + this.transactionCount = -1 this.$toasted.global.error(error.message) // what to do when loading balance fails? }) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js index 2c4b15e17..b116de9e8 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js @@ -61,6 +61,12 @@ describe('GddTransactionList', () => { }) describe('without any properties', () => { + beforeEach(async () => { + await wrapper.setProps({ + transactions: [], + transactionCount: -1, + }) + }) it('renders text saying that there are error.empty-transactionlist ', () => { expect(wrapper.find('div.gdd-transaction-list').text()).toContain( 'transaction.nullTransactions', diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index 52a66817a..f6c046fe6 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -7,7 +7,7 @@ {{ $t('error.no-transactionlist') }} -
+
{{ $t('error.empty-transactionlist') }}
@@ -134,7 +134,7 @@ :per-page="pageSize" :total-rows="transactionCount" > -
+
{{ $t('transaction.nullTransactions') }}