mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix send contribution amount
This commit is contained in:
parent
4615eb4fe6
commit
fa2c4f3bc3
@ -130,8 +130,6 @@ import InputTime from '@/components/Inputs/InputTime.vue'
|
||||
import InputAmount from '@/components/Inputs/InputAmount.vue'
|
||||
import InputTextarea from '@/components/Inputs/InputTextarea.vue'
|
||||
|
||||
const PATTERN_NON_DIGIT = /\D/g
|
||||
|
||||
export default {
|
||||
name: 'ContributionForm',
|
||||
components: {
|
||||
@ -162,7 +160,7 @@ export default {
|
||||
// return value.replace(PATTERN_NON_DIGIT, '')
|
||||
// },
|
||||
submit() {
|
||||
this.form.amount = this.form.amount.replace(PATTERN_NON_DIGIT, '')
|
||||
// this.form.amount = this.form.amount.replace(PATTERN_NON_DIGIT, '')
|
||||
// spreading is needed for testing
|
||||
this.$emit(this.form.id ? 'update-contribution' : 'set-contribution', { ...this.form })
|
||||
this.reset()
|
||||
|
||||
@ -88,7 +88,8 @@ export default {
|
||||
this.currentValue = this.$n(this.amountValue, 'ungroupedDecimal')
|
||||
}
|
||||
if (this.typ === 'ContributionForm') {
|
||||
this.currentValue = this.amountValue.toFixed()
|
||||
// this.currentValue = this.amountValue
|
||||
this.currentValue = this.$n(this.amountValue, 'ungroupedDecimal')
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -88,7 +88,7 @@ describe('Send', () => {
|
||||
|
||||
it('restores the previous data in the formular', () => {
|
||||
expect(wrapper.find("input[type='email']").vm.$el.value).toBe('user@example.org')
|
||||
expect(wrapper.find("input[type='email']").vm.$el.value).toBe('23.45')
|
||||
expect(wrapper.find("input[type='text']").vm.$el.value).toBe('23.45')
|
||||
expect(wrapper.find('textarea').vm.$el.value).toBe('Make the best of it!')
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user