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

226
Views
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
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!