change for tests

This commit is contained in:
ogerly 2022-07-15 10:11:07 +02:00
parent 6ce1fb2082
commit c170c48ac4
5 changed files with 29 additions and 16 deletions

View File

@ -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 = () => {

View File

@ -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',
},
],
}

View File

@ -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')

View File

@ -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 = () => {

View File

@ -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)
},
}
</script>