test reopening after loading more links

This commit is contained in:
Moriz Wahl 2022-05-04 10:55:11 +02:00
parent bee388c07c
commit 0e6ed809e2

View File

@ -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)
})
})
})
})
})