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

222
Vistas
How to write Unit Test case for Switch Statement that returns Component in Jest with React Testing Library

When I writing test case, I was able to reach out to case 0, but not able to reach other 1

const tabContent = (isCurrent) => {
    switch (isCurrent) {
      case 0:
        return <Component 1 />;
      case 1:
        return <Component 2 />;
      default:
        return null;
    }
  };

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Then set isCurrent to 1 to go to the first case tabContent(1) Any other value wil go to the default

about 4 years ago · Juan Pablo Isaza Denunciar
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