diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2bd99e045..104b85502 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -212,7 +212,7 @@ jobs:
report_name: Coverage Frontend
type: lcov
result_path: ./coverage/lcov.info
- min_coverage: 20
+ min_coverage: 21
token: ${{ github.token }}
##############################################################################
diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php
index 2ece0c726..6b744ff69 100644
--- a/community_server/src/Controller/AppRequestsController.php
+++ b/community_server/src/Controller/AppRequestsController.php
@@ -348,7 +348,7 @@ class AppRequestsController extends AppController
$decay = true;
$transactions = [];
$transactions_from_db = $stateUserTransactionsQuery->toArray();
-
+
if(count($transactions_from_db)) {
if($orderDirection == 'DESC') {
$transactions_from_db = array_reverse($transactions_from_db);
diff --git a/frontend/src/apis/communityAPI.js b/frontend/src/apis/communityAPI.js
index 25ef10f43..b2df337b8 100644
--- a/frontend/src/apis/communityAPI.js
+++ b/frontend/src/apis/communityAPI.js
@@ -35,7 +35,7 @@ const communityAPI = {
balance: async (sessionId) => {
return apiGet(CONFIG.COMMUNITY_API_URL + 'getBalance/' + sessionId)
},
- transactions: async (sessionId, firstPage = 1, items = 1000, order = 'DESC') => {
+ transactions: async (sessionId, firstPage = 1, items = 5, order = 'DESC') => {
return apiGet(
`${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${sessionId}`,
)
diff --git a/frontend/src/components/PaginationButtons.spec.js b/frontend/src/components/PaginationButtons.spec.js
new file mode 100644
index 000000000..7a03d0443
--- /dev/null
+++ b/frontend/src/components/PaginationButtons.spec.js
@@ -0,0 +1,53 @@
+import { mount } from '@vue/test-utils'
+import PaginationButtons from './PaginationButtons'
+
+const localVue = global.localVue
+
+describe('PaginationButtons', () => {
+ let wrapper
+
+ const Wrapper = () => {
+ return mount(PaginationButtons, { localVue })
+ }
+
+ describe('mount', () => {
+ beforeEach(() => {
+ wrapper = Wrapper()
+ })
+
+ it('renders the component', () => {
+ expect(wrapper.find('div.pagination-buttons').exists()).toBeTruthy()
+ })
+
+ it('has previous page button disabled by default', () => {
+ expect(wrapper.find('button.previous-page').attributes('disabled')).toBe('disabled')
+ })
+
+ it('has bext page button disabled by default', () => {
+ expect(wrapper.find('button.next-page').attributes('disabled')).toBe('disabled')
+ })
+
+ it('shows the text "1 / 1" by default"', () => {
+ expect(wrapper.find('p.text-center').text()).toBe('1 / 1')
+ })
+
+ describe('with active buttons', () => {
+ beforeEach(async () => {
+ await wrapper.setProps({
+ hasNext: true,
+ hasPrevious: true,
+ })
+ })
+
+ it('emits show-previous when previous page button is clicked', () => {
+ wrapper.find('button.previous-page').trigger('click')
+ expect(wrapper.emitted('show-previous')).toBeTruthy()
+ })
+
+ it('emits show-next when next page button is clicked', () => {
+ wrapper.find('button.next-page').trigger('click')
+ expect(wrapper.emitted('show-next')).toBeTruthy()
+ })
+ })
+ })
+})
diff --git a/frontend/src/components/PaginationButtons.vue b/frontend/src/components/PaginationButtons.vue
new file mode 100644
index 000000000..ac7ff73c6
--- /dev/null
+++ b/frontend/src/components/PaginationButtons.vue
@@ -0,0 +1,30 @@
+
+
+
+
diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue
index d6b9f44ff..b7dfe2b93 100755
--- a/frontend/src/views/Layout/DashboardLayout_gdd.vue
+++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue
@@ -106,9 +106,13 @@ export default {
this.$store.dispatch('logout')
this.$router.push('/login')
},
- async updateTransactions() {
+ async updateTransactions(pagination) {
this.pending = true
- const result = await communityAPI.transactions(this.$store.state.sessionId)
+ const result = await communityAPI.transactions(
+ this.$store.state.sessionId,
+ pagination.firstPage,
+ pagination.items,
+ )
if (result.success) {
this.GdtBalance = Number(result.result.data.gdtSum)
this.transactions = result.result.data.transactions
@@ -129,7 +133,7 @@ export default {
this.initScrollbar()
},
created() {
- this.updateTransactions()
+ this.updateTransactions({ firstPage: 1, items: 5 })
},
}
diff --git a/frontend/src/views/Pages/AccountOverview.vue b/frontend/src/views/Pages/AccountOverview.vue
index 5f262f627..f25cce48b 100644
--- a/frontend/src/views/Pages/AccountOverview.vue
+++ b/frontend/src/views/Pages/AccountOverview.vue
@@ -31,10 +31,10 @@