adapt unit tests for transaction confirmation link component to changes for new design

This commit is contained in:
mahula 2022-12-03 22:18:02 +01:00
parent 74468c77bc
commit 7fc92f1b4b

View File

@ -41,10 +41,6 @@ describe('GddSend confirm', () => {
selected: 'link',
})
})
it('renders the component div.confirm-box-link', () => {
expect(wrapper.findAll('div.confirm-box-link').at(0).exists()).toBeTruthy()
})
})
describe('has totalBalance under 0', () => {
@ -58,5 +54,32 @@ describe('GddSend confirm', () => {
expect(wrapper.find('.send-button').attributes('disabled')).toBe('disabled')
})
})
describe('send now button', () => {
beforeEach(() => {
jest.clearAllMocks()
})
describe('single click', () => {
beforeEach(async () => {
await wrapper.find('button.btn.btn-gradido').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.btn-gradido').trigger('click')
await wrapper.find('button.btn.btn-gradido').trigger('click')
})
it('emits send transaction one time', () => {
expect(wrapper.emitted('send-transaction')).toHaveLength(1)
})
})
})
})
})