From 2c74574f240a4d175ecc2f97ec39a98239bc3f69 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 12 Jul 2021 11:16:56 +0200 Subject: [PATCH] test emit of update-transaction after creation --- .../views/Pages/UserProfileTransactionList.spec.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/Pages/UserProfileTransactionList.spec.js b/frontend/src/views/Pages/UserProfileTransactionList.spec.js index b075b2381..0761c5032 100644 --- a/frontend/src/views/Pages/UserProfileTransactionList.spec.js +++ b/frontend/src/views/Pages/UserProfileTransactionList.spec.js @@ -23,11 +23,19 @@ describe('UserProfileTransactionList', () => { expect(wrapper.findComponent({ name: 'GddTransactionList' }).exists()).toBeTruthy() }) - it('emist update-transactions when update-transactions is called', async () => { - wrapper.findComponent({ name: 'GddTransactionList' }).vm.$emit('update-transactions') + it('emits update-transactions after creation', () => { expect(wrapper.emitted('update-transactions')).toEqual( expect.arrayContaining([expect.arrayContaining([{ firstPage: 1, items: 25 }])]), ) }) + + it('emist update-transactions when update-transactions is called', () => { + wrapper + .findComponent({ name: 'GddTransactionList' }) + .vm.$emit('update-transactions', { firstPage: 2, items: 25 }) + expect(wrapper.emitted('update-transactions')).toEqual( + expect.arrayContaining([expect.arrayContaining([{ firstPage: 2, items: 25 }])]), + ) + }) }) })