From a8de79c0c61ad3589f49d4216fb5aeb08b7f33ae Mon Sep 17 00:00:00 2001 From: elweyn Date: Wed, 19 Jan 2022 15:08:29 +0100 Subject: [PATCH] yarn test fixed --- .../CreationTransactionListFormular.spec.js | 19 ++++++++++++++++--- .../CreationTransactionListFormular.vue | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/admin/src/components/CreationTransactionListFormular.spec.js b/admin/src/components/CreationTransactionListFormular.spec.js index 32dcb6c9d..e531ce040 100644 --- a/admin/src/components/CreationTransactionListFormular.spec.js +++ b/admin/src/components/CreationTransactionListFormular.spec.js @@ -15,7 +15,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({ decayDuration: 0, memo: 'Testing', transactionId: 1, - name: 'Bibi', + name: 'Gradido Akademie', email: 'bibi@bloxberg.de', date: new Date(), decay: { @@ -34,7 +34,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({ decayDuration: 0, memo: 'Testing 2', transactionId: 2, - name: 'Bibi', + name: 'Gradido Akademie', email: 'bibi@bloxberg.de', date: new Date(), decay: { @@ -53,6 +53,16 @@ const apolloQueryMock = jest.fn().mockResolvedValue({ const toastedErrorMock = jest.fn() const mocks = { + $moment: jest.fn(() => { + return { + format: jest.fn((m) => m), + subtract: jest.fn(() => { + return { + format: jest.fn((m) => m), + } + }), + } + }), $t: jest.fn((t) => t), $apollo: { query: apolloQueryMock, @@ -64,6 +74,7 @@ const mocks = { const propsData = { userId: 1, + fields: ['date', 'balance', 'name', 'memo', 'decay'], } describe('CreationTransactionListFormular', () => { @@ -92,7 +103,9 @@ describe('CreationTransactionListFormular', () => { ) }) - it('has two values for the transaction', () => { + it('has two values for the transaction', async () => { + await wrapper.vm.$nextTick() + console.log(wrapper.html()) expect(wrapper.find('tbody').findAll('tr').length).toBe(2) }) diff --git a/admin/src/components/CreationTransactionListFormular.vue b/admin/src/components/CreationTransactionListFormular.vue index 6f5864f7c..54684b679 100644 --- a/admin/src/components/CreationTransactionListFormular.vue +++ b/admin/src/components/CreationTransactionListFormular.vue @@ -53,7 +53,9 @@ export default { }, }) .then((result) => { + console.log(result) this.items = result.data.transactionList.transactions.filter((t) => t.type === 'creation') + console.log( this.items) }) .catch((error) => { this.$toasted.error(error.message)