I am trying to test a component with testing-library. The problem I'm facing is how to introduce text automatically in an input
. Usually this could be achieved by:
const inputName = screen.getByPlaceholderText(/name/i)
fireEvent.click(inputName)
fireEvent.change(inputName, { target: { value: 'test name' } })
But in my case I am using the library cleave.js
to format the input and seems that fireEvent.change
is not able to introduce the text.
Does anyone know how to address this problem?