From 0e6ed809e25b06e16f2ff925b55fd6c67ccd66c7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 4 May 2022 10:55:11 +0200 Subject: [PATCH] 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) + }) + }) + }) }) })