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

201
Views
JEST Change react-calendar value

I'm implementing some tests for a search component in which I'm using react-calendar and I need to perform some test to the calendar too by changing its value...

For now, I cannot change the calendar's value with

fireEvent.change(getByTestId(/test-checkIn-calendar/).children[1], {target: {value: new Date()})

Im using children prop cause I cannot put a data-testid on my calendar component:

<CalendarContainer id="checkOut" data-testid="test-checkOut-calendar">
  <SearchLabel>{t("search.checkoutDate")}</SearchLabel>
  <Calendar
  className="react-calendar checkIn-picker"
  onChange={onCheckOutChange}
  value={checkOutDate}
  minDate={checkInDate as unknown as Date}
  />
</CalendarContainer>

but I'm getting this error:

The given element does not have a value setter
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!