mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1704 from gradido/1686-When-sending-takes-longer-no-twice-results
add extra disabled variable for send emit, disabled send by emit
This commit is contained in:
commit
90bafd462a
@ -60,7 +60,6 @@ export default {
|
||||
amount: { type: Number, required: true },
|
||||
memo: { type: String, required: true },
|
||||
loading: { type: Boolean, required: true },
|
||||
selected: { type: String, required: true },
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -45,6 +45,33 @@ describe('GddSend confirm', () => {
|
||||
it('renders the component div.confirm-box-send', () => {
|
||||
expect(wrapper.find('div.confirm-box-send').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
describe('send now button', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
describe('single click', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('button.btn-success').trigger('click')
|
||||
})
|
||||
|
||||
it('emits send transaction one time', () => {
|
||||
expect(wrapper.emitted('send-transaction')).toHaveLength(1)
|
||||
})
|
||||
})
|
||||
|
||||
describe('double click', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('button.btn-success').trigger('click')
|
||||
await wrapper.find('button.btn-success').trigger('click')
|
||||
})
|
||||
|
||||
it('emits send transaction one time', () => {
|
||||
expect(wrapper.emitted('send-transaction')).toHaveLength(1)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -58,7 +58,11 @@
|
||||
<b-button @click="$emit('on-reset')">{{ $t('form.cancel') }}</b-button>
|
||||
</b-col>
|
||||
<b-col class="text-right">
|
||||
<b-button variant="success" :disabled="loading" @click="$emit('send-transaction')">
|
||||
<b-button
|
||||
variant="success"
|
||||
:disabled="disabled"
|
||||
@click="$emit('send-transaction'), (disabled = true)"
|
||||
>
|
||||
{{ $t('form.send_now') }}
|
||||
</b-button>
|
||||
</b-col>
|
||||
@ -73,8 +77,11 @@ export default {
|
||||
email: { type: String, required: false, default: '' },
|
||||
amount: { type: Number, required: true },
|
||||
memo: { type: String, required: true },
|
||||
loading: { type: Boolean, required: true },
|
||||
selected: { type: String, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
disabled: false,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -12,11 +12,9 @@
|
||||
<template #transactionConfirmationSend>
|
||||
<transaction-confirmation-send
|
||||
:balance="balance"
|
||||
:selected="transactionData.selected"
|
||||
:email="transactionData.email"
|
||||
:amount="transactionData.amount"
|
||||
:memo="transactionData.memo"
|
||||
:loading="loading"
|
||||
@send-transaction="sendTransaction"
|
||||
@on-reset="onReset"
|
||||
></transaction-confirmation-send>
|
||||
@ -24,7 +22,6 @@
|
||||
<template #transactionConfirmationLink>
|
||||
<transaction-confirmation-link
|
||||
:balance="balance"
|
||||
:selected="transactionData.selected"
|
||||
:email="transactionData.email"
|
||||
:amount="transactionData.amount"
|
||||
:memo="transactionData.memo"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user