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 test cases are stopping for the component

I am trying to spread two arrays into one. In React, I am looping state array and in that loop for a particular value, I am updating with previous value with another value. But it is making unit test cases are freezing Here is the sample code:

const formValues = [...this.state.formValues];
formValues.forEach((item) => {
if(item.label === 'policy'){
const fieldPermissions = this.props.permissions;
item.value = [...item.value, ...fieldPermissions];
}
})

`

In the above code, I am spreading field emissions and item. value and assigning to item.value, UI is working as expected. But unit test cases are feezing, not running. On removing spreading of item.value, unit test cases are working. Tried different ways to figure it out like concat, array loop, push, etc. Can anyone help me with this?

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