How to use the @better-scroll/core/src/__tests__/__utils__/event.dispatchMouse function in @better-scroll/core

To help you get started, we’ve selected a few @better-scroll/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ustbhuangyi / better-scroll / packages / core / src / base / __tests__ / ActionsHandler.spec.ts View on Github external
it('should invoice move method when dispatch touchmove', () => {
    actionsHandler = new ActionsHandler(wrapper, options)
    const moveMockHandler = jest.fn().mockImplementation(() => {
      return 'dummy test'
    })

    actionsHandler.hooks.on('move', moveMockHandler)

    dispatchMouse(wrapper, 'mousedown')

    dispatchMouse(window, 'mousemove')

    expect(moveMockHandler).toBeCalled()
  })
github ustbhuangyi / better-scroll / packages / core / src / base / __tests__ / ActionsHandler.spec.ts View on Github external
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()
  })
github ustbhuangyi / better-scroll / packages / core / src / base / __tests__ / ActionsHandler.spec.ts View on Github external
it('should invoice move method when dispatch touchmove', () => {
    actionsHandler = new ActionsHandler(wrapper, options)
    const moveMockHandler = jest.fn().mockImplementation(() => {
      return 'dummy test'
    })

    actionsHandler.hooks.on('move', moveMockHandler)

    dispatchMouse(wrapper, 'mousedown')

    dispatchMouse(window, 'mousemove')

    expect(moveMockHandler).toBeCalled()
  })
github ustbhuangyi / better-scroll / packages / core / src / base / __tests__ / ActionsHandler.spec.ts View on Github external
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()
  })
})