-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Description
Description
Rendering a simple <ReactSlider ... /> with React Testing Library:
const slider = screen.getByRole("slider");
const currentValue = slider.getAttribute("aria-valuenow");
console.log(currentValue); // Logs '2'
fireEvent.change(screen.getByRole("slider"), {
target: { value: { now: Number(currentValue) - 1 } },
});This fails with the error The given element does not have a value setter. (I tried a ton of workaround inputs, such as target: {value: ... } }, value: { },, value: { now: {...}}
It would be nice to be able to test the onChange functionality nested within this component without having to engage in tedious workarounds.
CodeSandbox
Metadata
Metadata
Assignees
Labels
No labels