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

228
Vistas
Call onSelect callback for Air datepicker from Jest unit tests

I am writing a wrapper on top of Air-datepicker in React.js for our component library. I have chosen to pass/override 'onSelect' hook while passing the options to Datepicker while instantiating.

While writing the unit test using Jest and react-testing-library, I am not able to invoke onSelect handler through the event mechanism. The steps I am following:

  1. rendered the component.
  2. picked the text input component (a React component) using screen API.
  3. Fired focusIn event on text input, so that date picker will be displayed.
  4. Next, I am trying to select datepicker-cell.
  5. Next I am trying to fire the click event on datepicker-cell.
  6. If I put the breakpoint in onSelect hook, the control never comes to this hook.

Could you please help, how can I solve this issue?

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