Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda