Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

201
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda