I have a range slider within my own functional component, and want to test the user setting the slider values from Jest.
I have tried:
const draggerEles = within(rangeSliderEle).getAllByTitle("Drag")
fireEvent.change(draggerEles[0], { target: { value:7 } })
but it errors with "The given element does not have a value setter"
I could be setting the wrong element of course, maybe I should set the slider role elements. But I've tried those as well, to no avail.
How do I find out what setters or events are supported for an element?
interestingly, using:
act(() => draggerEles[0].setAttribute("aria-valuenow", "7"));
does modify the component
but doesnt seem to cause any re-render!