Open Przemoo16 opened 7 months ago
I'm sorry. I can't help you with this at the moment because I don't have any experience with it yet. However, I plan to write tests for Modular Forms in January and February and will be able to help you then.
I'm sorry. I can't help you with this at the moment because I don't have any experience with it yet. However, I plan to write tests for Modular Forms in January and February and will be able to help you then.
I'd be grateful, thanks. Meanwhile, I would also investigate it and put comments here if I figure it out.
I was able to make the test work. The missing piece was that besides triggering the input
event, I also had to change the value of the input directly, like this:
const myInput = screen.querySelector('#myInput') as HTMLInputElement;
myInput.value = 'New Value';
await userEvent(myInput, 'input', { target: { 'New Value' } });
Thank you for the tip!
Hi, I'm trying to write unit tests for the Qwik app that uses modular-forms. However, I cannot simulate filling the input with some value. Is there any user guide on how to write unit tests for modular forms, or if not, can someone help me to make it work?
My current approach that doesn't work:
Part of the component: