From bee388c07c047f4c9646b5d73c4a0509ddfe7d08 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 May 2022 10:46:23 +0200 Subject: [PATCH 1/3] fix: Reload Transaction Link List Always on Page 1 --- .../src/components/Transactions/TransactionLinkSummary.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Transactions/TransactionLinkSummary.vue b/frontend/src/components/Transactions/TransactionLinkSummary.vue index c24410924..cbce57029 100644 --- a/frontend/src/components/Transactions/TransactionLinkSummary.vue +++ b/frontend/src/components/Transactions/TransactionLinkSummary.vue @@ -84,7 +84,11 @@ export default { this.visible = false } else { this.transactionLinks = [] - this.updateListTransactionLinks() + if (this.currentPage === 1) { + this.updateListTransactionLinks() + } else { + this.currentPage = 1 + } this.visible = true } }, From 0e6ed809e25b06e16f2ff925b55fd6c67ccd66c7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 May 2022 10:55:11 +0200 Subject: [PATCH 2/3] test reopening after loading more links --- .../TransactionLinkSummary.spec.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js index b60cc60f8..370233c42 100644 --- a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js +++ b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js @@ -227,6 +227,36 @@ describe('TransactionLinkSummary', () => { fetchPolicy: 'network-only', }) }) + + describe('close transaction link list', () => { + beforeEach(async () => { + wrapper.find('div.transaction-link-details').trigger('click') + }) + describe('reopen transaction link list', () => { + beforeEach(async () => { + jest.clearAllMocks() + wrapper.find('div.transaction-link-details').trigger('click') + }) + + it('calls the API once', () => { + expect(apolloQueryMock).toBeCalledTimes(1) + }) + + it('calls the API with curren page one', () => { + expect(apolloQueryMock).toBeCalledWith({ + query: listTransactionLinks, + variables: { + currentPage: 1, + }, + fetchPolicy: 'network-only', + }) + }) + + it('has four transactionLinks', () => { + expect(wrapper.vm.transactionLinks).toHaveLength(4) + }) + }) + }) }) }) From 837f644e255acffe84397e298ccd885ceec107ed Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 May 2022 10:58:24 +0200 Subject: [PATCH 3/3] fix typo --- .../src/components/Transactions/TransactionLinkSummary.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js index 370233c42..ba07f7aff 100644 --- a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js +++ b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js @@ -242,7 +242,7 @@ describe('TransactionLinkSummary', () => { expect(apolloQueryMock).toBeCalledTimes(1) }) - it('calls the API with curren page one', () => { + it('calls the API with current page one', () => { expect(apolloQueryMock).toBeCalledWith({ query: listTransactionLinks, variables: {