Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should invoice end method when dispatch touchend', () => {
actionsHandler = new ActionsHandler(wrapper, options)
const endMockHandler = jest.fn().mockImplementation(() => {
return 'dummy test'
})
actionsHandler.hooks.on('end', endMockHandler)
dispatchMouse(wrapper, 'mousedown')
dispatchMouse(window, 'mouseup')
expect(endMockHandler).toBeCalled()
})
it('should make bs not take effect when manipulate textarea DOM tag', () => {
const textarea = document.createElement('textarea')
const content = document.createElement('div')
content.appendChild(textarea)
wrapper.appendChild(content)
actionsHandler = new ActionsHandler(wrapper, options)
dispatchMouse(textarea, 'mousedown')
expect(actionsHandler.initiated).toBeFalsy()
})
})
it('should bind click handler when options.disableMouse is true', () => {
actionsHandler = new ActionsHandler(wrapper, options)
const wrapperEventsName = actionsHandler.wrapperEventRegister.events.map(
event => event.name
)
const targetEventsName = actionsHandler.targetEventRegister.events.map(
event => event.name
)
expect(wrapperEventsName).toMatchObject(['mousedown'])
expect(targetEventsName).toMatchObject(['mousemove', 'mouseup'])
})