test double click on send now button

This commit is contained in:
Moriz Wahl 2022-03-31 20:14:47 +02:00
parent d237634f75
commit 47abb8e9aa

View File

@ -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)
})
})
})
})
})
})