From 1a34db8b1894a757bba2fc5b2ac5953d1c923ad5 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Nov 2022 20:36:34 +0100 Subject: [PATCH] fix test --- .../ContributionMessagesFormular.spec.js | 4 ++-- .../Contributions/ContributionListItem.spec.js | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js index aba5abc34..42deac9cb 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js +++ b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js @@ -67,9 +67,9 @@ describe('ContributionMessagesFormular', () => { await wrapper.find('form').trigger('submit') }) - it('emitted "get-list-contribution-messages" with data', async () => { + it('emitted "get-list-contribution-messages" with false', async () => { expect(wrapper.emitted('get-list-contribution-messages')).toEqual( - expect.arrayContaining([expect.arrayContaining([42])]), + expect.arrayContaining([expect.arrayContaining([false])]), ) }) diff --git a/frontend/src/components/Contributions/ContributionListItem.spec.js b/frontend/src/components/Contributions/ContributionListItem.spec.js index f477d1c2c..66e3bcef9 100644 --- a/frontend/src/components/Contributions/ContributionListItem.spec.js +++ b/frontend/src/components/Contributions/ContributionListItem.spec.js @@ -9,6 +9,7 @@ describe('ContributionListItem', () => { const mocks = { $t: jest.fn((t) => t), $d: jest.fn((d) => d), + $apollo: { query: jest.fn().mockResolvedValue() }, } const propsData = { @@ -143,5 +144,16 @@ describe('ContributionListItem', () => { }) }) }) + + describe('getListContributionMessages', () => { + beforeEach(() => { + wrapper + .findComponent({ name: 'ContributionMessagesList' }) + .vm.$emit('get-list-contribution-messages') + }) + it('emits closeAllOpenCollapse', () => { + expect(wrapper.emitted('closeAllOpenCollapse')).toBeTruthy() + }) + }) }) })