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

203
Vistas
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
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