From 47abb8e9aa3f00563cec470d50de2ee5eba0ab23 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 31 Mar 2022 20:14:47 +0200 Subject: [PATCH 1/2] test double click on send now button --- .../TransactionConfirmationSend.spec.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js b/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js index 38dd82866..21462ebab 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.spec.js @@ -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) + }) + }) + }) }) }) }) From 13519d69936d7e379d23d04e33ada086d6692564 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 31 Mar 2022 20:19:34 +0200 Subject: [PATCH 2/2] remove unused properties --- .../src/components/GddSend/TransactionConfirmationLink.vue | 1 - .../src/components/GddSend/TransactionConfirmationSend.vue | 6 ++---- frontend/src/pages/Send.vue | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionConfirmationLink.vue b/frontend/src/components/GddSend/TransactionConfirmationLink.vue index 31ae01cc3..fd2e798eb 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationLink.vue +++ b/frontend/src/components/GddSend/TransactionConfirmationLink.vue @@ -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 }, }, } diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.vue b/frontend/src/components/GddSend/TransactionConfirmationSend.vue index 6ac367795..25519f4ed 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationSend.vue +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.vue @@ -61,7 +61,7 @@ {{ $t('form.send_now') }} @@ -77,12 +77,10 @@ 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: this.loading, + disabled: false, } }, } diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue index 270187bec..dd158f2ee 100644 --- a/frontend/src/pages/Send.vue +++ b/frontend/src/pages/Send.vue @@ -12,11 +12,9 @@