From 0f0a5a88070bdf7ef062a2de018c374730adf6f3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 19 Jan 2023 12:13:57 +0100 Subject: [PATCH] fix tests after new layout --- .../TransactionLinkSummary.spec.js | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js index a5bdc4714..d0086ceab 100644 --- a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js +++ b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js @@ -17,6 +17,12 @@ const mocks = { $apollo: { query: apolloQueryMock, }, + $store: { + state: { + firstName: 'Bibi', + lastName: 'Bloxberg', + }, + }, } const propsData = { @@ -102,10 +108,10 @@ describe('TransactionLinkSummary', () => { describe('click on transaction links', () => { beforeEach(async () => { - wrapper.find('div.transaction-slot-link').trigger('click') + wrapper.find('div.row').trigger('click') }) - it.skip('calls the API to get the list transaction links', () => { + it('calls the API to get the list transaction links', () => { expect(apolloQueryMock).toBeCalledWith({ query: listTransactionLinks, variables: { @@ -115,14 +121,14 @@ describe('TransactionLinkSummary', () => { }) }) - it.skip('has four transactionLinks', () => { + it('has four transactionLinks', () => { expect(wrapper.vm.transactionLinks).toHaveLength(4) }) describe('close transaction link details', () => { beforeEach(() => { jest.clearAllMocks() - wrapper.find('div.transaction-slot-link').trigger('click') + wrapper.find('div.row').trigger('click') }) it('does not call the API', () => { @@ -136,10 +142,10 @@ describe('TransactionLinkSummary', () => { describe('reopen transaction link details', () => { beforeEach(() => { jest.clearAllMocks() - wrapper.find('div.transaction-slot-link').trigger('click') + wrapper.find('div.row').trigger('click') }) - it.skip('calls the API to get the list transaction links', () => { + it('calls the API to get the list transaction links', () => { expect(apolloQueryMock).toBeCalledWith({ query: listTransactionLinks, variables: { @@ -149,7 +155,7 @@ describe('TransactionLinkSummary', () => { }) }) - it.skip('has four transactionLinks', () => { + it('has four transactionLinks', () => { expect(wrapper.vm.transactionLinks).toHaveLength(4) }) }) @@ -214,8 +220,8 @@ describe('TransactionLinkSummary', () => { }) }) - it('has four transactionLinks', () => { - expect(wrapper.vm.transactionLinks).toHaveLength(4) + it('has eight transactionLinks', () => { + expect(wrapper.vm.transactionLinks).toHaveLength(8) }) it('loads more transaction links', () => { @@ -230,19 +236,19 @@ describe('TransactionLinkSummary', () => { describe('close transaction link list', () => { beforeEach(async () => { - wrapper.find('div.transaction-slot-link').trigger('click') + wrapper.find('div.row').trigger('click') }) describe('reopen transaction link list', () => { beforeEach(async () => { jest.clearAllMocks() - wrapper.find('div.transaction-slot-link').trigger('click') + wrapper.find('div.row').trigger('click') }) - it.skip('calls the API once', () => { + it('calls the API once', () => { expect(apolloQueryMock).toBeCalledTimes(1) }) - it.skip('calls the API with current page one', () => { + it('calls the API with current page one', () => { expect(apolloQueryMock).toBeCalledWith({ query: listTransactionLinks, variables: { @@ -289,10 +295,10 @@ describe('TransactionLinkSummary', () => { }) }) - describe.skip('loads transaction links with error', () => { + describe('loads transaction links with error', () => { beforeEach(() => { apolloQueryMock.mockRejectedValue({ message: 'OUCH!' }) - wrapper.find('div.transaction-slot-link').trigger('click') + wrapper.find('div.row').trigger('click') }) it('toasts an error message', () => {