radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.91k stars 831 forks source link

Slider component is unable to be tested in vitest #3194

Open Kikketer opened 3 weeks ago

Kikketer commented 3 weeks ago

Bug report

Current Behavior

I'm unable to use vitest to test the slider component even when using the vitest.setup recommendations from previous bug reports.

https://github.com/Kikketer/vitest-slider-test/blob/716baf6a014eebb5a18123da7cd3a3d7a6830d85/vitest.setup.ts

Expected behavior

Vitest + slider component should be testable, even if it does require some modifications to the vitest.setup file.

Reproducible example

https://github.com/Kikketer/vitest-slider-test

Suggested solution

Perhaps a bit of documentation (as suggested here) around how to setup vitest + radix slider

Additional context

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-slider 1.2.1
React n/a 18.3.1
Browser Chrome
Assistive tech none
Node n/a 20
npm/yarn npm 10.8.1
Operating System macOs 14.6.1
vitest n/a 2.1.3
vite n/a 5.4.9
@testing-library/jest-dom n/a 6.6.2
@testing-library/react n/a 16.0.1
jsdom n/a 25.0.1