Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('triggers dblclick on doubleClick', async () => {
const spy = jest.fn()
const {getByRole} = render({
render(h) {
return h('input', {
on: {dblclick: spy},
})
},
})
const elem = getByRole('textbox')
await fireEvent.doubleClick(elem)
expect(spy).toHaveBeenCalledTimes(1)
})