diff --git a/frontend/src/components/Contributions/ContributionForm.spec.js b/frontend/src/components/Contributions/ContributionForm.spec.js index 4d39e2942..633d0e1ae 100644 --- a/frontend/src/components/Contributions/ContributionForm.spec.js +++ b/frontend/src/components/Contributions/ContributionForm.spec.js @@ -8,6 +8,12 @@ describe('ContributionForm', () => { const mocks = { $t: jest.fn((t) => t), + $d: jest.fn((d) => d), + $store: { + state: { + creation: ["1000","1000","1000"], + }, + }, } const Wrapper = () => { diff --git a/frontend/src/components/Contributions/ContributionList.spec.js b/frontend/src/components/Contributions/ContributionList.spec.js index 7accfcad9..ba6e15786 100644 --- a/frontend/src/components/Contributions/ContributionList.spec.js +++ b/frontend/src/components/Contributions/ContributionList.spec.js @@ -8,31 +8,32 @@ describe('ContributionList', () => { const mocks = { $t: jest.fn((t) => t), + $d: jest.fn((d) => d), } const propsData = { + contributionCount: 3, + showPagination: true, + pageSize: 25, items: [ { - id: '0', + id: 0, date: '07/06/2022', memo: 'Ich habe 10 Stunden die Elbwiesen von Müll befreit.', - amount: 200, - status: 'pending', + amount: '200', }, { - id: '1', + id: 1, date: '06/22/2022', memo: 'Ich habe 30 Stunden Frau Müller beim EInkaufen und im Haushalt geholfen.', - amount: 600, - status: 'pending', + amount: '600', }, { - id: '2', + id: 2, date: '05/04/2022', memo: 'Ich habe 50 Stunden den Nachbarkindern bei ihren Hausaufgaben geholfen und Nachhilfeunterricht gegeben.', - amount: 1000, - status: 'pending', + amount: '1000', }, ], } diff --git a/frontend/src/components/Menu/Sidebar.spec.js b/frontend/src/components/Menu/Sidebar.spec.js index 982192a8f..afee93def 100644 --- a/frontend/src/components/Menu/Sidebar.spec.js +++ b/frontend/src/components/Menu/Sidebar.spec.js @@ -47,11 +47,11 @@ describe('Sidebar', () => { it('has first nav-item "navigation.transactions" in navbar', () => { expect(wrapper.findAll('.nav-item').at(2).text()).toEqual('navigation.transactions') }) - it('has first nav-item "navigation.profile" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(3).text()).toEqual('navigation.profile') - }) it('has a link to the community area', () => { - expect(wrapper.findAll('.nav-item').at(4).text()).toContain('navigation.community') + expect(wrapper.findAll('.nav-item').at(3).text()).toContain('navigation.community') + }) + it('has first nav-item "navigation.profile" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(4).text()).toEqual('navigation.profile') }) it('has a link to the members area', () => { expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.members_area') diff --git a/frontend/src/pages/Community.spec.js b/frontend/src/pages/Community.spec.js index 7f1540369..a90f035ee 100644 --- a/frontend/src/pages/Community.spec.js +++ b/frontend/src/pages/Community.spec.js @@ -1,11 +1,9 @@ import { mount } from '@vue/test-utils' import Community from './Community' -// import { createContribution } from '@/graphql/mutations' - -// import { toastErrorSpy } from '@test/testSetup' const localVue = global.localVue +const mockStoreDispach = jest.fn() const apolloMutationMock = jest.fn() apolloMutationMock.mockResolvedValue('success') @@ -14,9 +12,13 @@ describe('Community', () => { const mocks = { $t: jest.fn((t) => t), + $d: jest.fn((d) => d), $apollo: { mutate: apolloMutationMock, }, + $store: { + dispatch: mockStoreDispach, + }, } const Wrapper = () => { diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 4774fc3c0..ddf4333bf 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -118,12 +118,16 @@ export default { this.form.memo = item.memo this.form.amount = item.amount }, + updateTransactions(pagination) { + this.$emit('update-transactions', pagination) + }, }, created() { this.updateListContributions({ currentPage: this.currentPage, pageSize: this.pageSize, }) + this.updateTransactions(0) }, }