Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
How can I use the react testing library to test the style characteristics of an range input?

I need to get the styles of the input range-slider in javascript so i can test it.

I have made a range slider component which accepts different style properties and adding those to the: input[type="range"]::-webkit-slider-runnable-track style.

And i want to test so the styles on input[type="range"]::-webkit-slider-runnable-track is the styles i pass down to the component. But i have not found any way to get the styles of the input[type="range"]::-webkit-slider-runnable-track.

A pseudo example to test this would be:

const el = document.querySelector('input[type="range"]')
expect(el).toHaveStyle("background-image": "the prop style")

The component looks like this:

       const Input = (props) => {
       return (
        <>
        <style>{generateStyles(props)}</style>
        <input
         data-testid="rangeSliderID"
         type="range" />
        </>
)}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!