fix tests

This commit is contained in:
ogerly 2023-01-17 11:10:06 +01:00
parent 07dc5cf5d4
commit 4f0a78022a
4 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,7 @@ describe('ContributionForm', () => {
date: '',
memo: '',
amount: '',
hours: 0,
},
isThisMonth: true,
minimalDate: new Date(),
@ -375,6 +376,7 @@ describe('ContributionForm', () => {
date: now,
memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
amount: '200',
hours: 0,
},
]),
]),

View File

@ -109,7 +109,7 @@ export default {
this.form.id = null
this.form.date = ''
this.form.memo = ''
this.form.hours = null
this.form.hours = 0
this.form.amount = ''
},
},

View File

@ -74,7 +74,7 @@ describe('InputHour', () => {
it('emits input with new value', async () => {
await wrapper.find('input').setValue('12')
expect(wrapper.emitted('input')).toBeTruthy()
expect(wrapper.emitted('input')).toEqual([['12']])
expect(wrapper.emitted('input')).toEqual([[12]])
})
})

View File

@ -50,7 +50,7 @@ export default {
},
watch: {
currentValue() {
this.$emit('input', isNaN(Number(this.currentValue)) ? 0 : Number(this.currentValue))
this.$emit('input', Number(this.currentValue))
},
value() {
if (this.value !== this.currentValue) this.currentValue = this.value