Cannot test apps with sliders in cypress because of this line
https://github.com/NightCatSama/vue-slider-component/blob/master/lib/utils/index.ts#L29
When I want to trigger some mouse movement event on vue-slider-dot I've got error because event is not instanceof MouseEvent somehow, and you are getting targetTouches for granted.
There are some libs that are not using MouseEvent directly.
I think that better solution will be to check if event has pageX and pageY properties and if not - check if it has any targetTouches within.
cypress code
cy.get('.vue-slider-dot')
.trigger('mousedown', 'center', { which: 1 })
.trigger('mousemove', {
which: 1,
clientX: offset.left - 10,
clientY: offset.top
})
.trigger('mouseup', { which: 1, force: true })
Fixed in v3.0.27.
Thanks for the feedback.
thanks, now it's working with pageX property
.trigger('mousemove',{pageX: 100, pageY: 100})
thanks again
Most helpful comment
thanks, now it's working with
pageXpropertythanks again