reset transaction data after success from server

This commit is contained in:
Moriz Wahl 2022-03-22 18:33:16 +01:00
parent 421ae60507
commit 31e07e70ce
3 changed files with 2 additions and 17 deletions

View File

@ -200,7 +200,7 @@ describe('GddSend', () => {
expect(wrapper.find('button[type="reset"]').text()).toBe('form.reset')
})
it('clears all fields on click and emits set-transaction', async () => {
it('clears all fields on click', async () => {
await wrapper.find('#input-group-1').find('input').setValue('someone@watches.tv')
await wrapper.find('#input-group-2').find('input').setValue('87.23')
await wrapper.find('#input-group-3').find('textarea').setValue('Long enough')
@ -213,16 +213,6 @@ describe('GddSend', () => {
expect(wrapper.vm.form.email).toBe('')
expect(wrapper.vm.form.amount).toBe('')
expect(wrapper.vm.form.memo).toBe('')
expect(wrapper.emitted('set-transaction')).toEqual([
[
{
selected: 'send',
email: '',
amount: 0,
memo: '',
},
],
])
})
})

View File

@ -192,12 +192,6 @@ export default {
this.form.email = ''
this.form.amount = ''
this.form.memo = ''
this.$emit('set-transaction', {
selected: this.selected,
email: '',
amount: 0,
memo: '',
})
},
normalizeAmount(isValid) {
this.amountFocused = false

View File

@ -129,6 +129,7 @@ export default {
.then(() => {
this.error = false
this.updateTransactions({})
this.transactionData = { ...EMPTY_TRANSACTION_DATA }
this.currentTransactionStep = TRANSACTION_STEPS.transactionResultSendSuccess
})
.catch((err) => {