Estoy tratando de probar un componente React que debería enfocar todos los campos que tienen ciertas identificaciones al menos una vez, usando Jest y Testing Library. Por ejemplo, si los componentes renderizados son:
import { render } from '@testing-library/react'; const { container } = render( <div > <input id='input1' /> <input id='input2' /> <FocusCertainFieldsAtLeastOnce /> <div /> ); Necesito probar si <FocusCertainFieldsAtLeastOnce /> puede enfocar ambos elementos <input /> con ids 'input1' y 'input2' al menos una vez.
Sé cómo lograr esto usando Jest y Enzyme y quiero algo similar a esta respuesta pero usando Jest y Testing Library en su lugar.