Reset amount in Contribution form and write a test

This commit is contained in:
Wolfgang Huß 2022-07-25 14:06:10 +02:00
parent d06d7c30cd
commit 5fd8ea2223
2 changed files with 9 additions and 1 deletions

View File

@ -111,6 +111,7 @@ export default {
this.form.date = ''
this.id = null
this.form.memo = ''
this.form.amount = '0'
},
},
computed: {

View File

@ -190,6 +190,13 @@ describe('Community', () => {
fetchPolicy: 'network-only',
})
})
it('set all data to the default values)', () => {
expect(wrapper.vm.form.id).toBe(null)
expect(wrapper.vm.form.date).toBe('')
expect(wrapper.vm.form.memo).toBe('')
expect(wrapper.vm.form.amount).toBe('0')
})
})
describe('with error', () => {
@ -376,7 +383,7 @@ describe('Community', () => {
})
})
it('sets the form date to the new values', () => {
it('sets the form data to the new values', () => {
expect(wrapper.vm.form.id).toBe(2)
expect(wrapper.vm.form.date).toBe(now)
expect(wrapper.vm.form.memo).toBe('Mein Beitrag zur Gemeinschaft für diesen Monat ...')