DEV Community

Discussion on: How I usually test my ReactJS components

Collapse
 
alexr89 profile image
Alex

Hi Ioannis,

Great post! I am wondering though:

How would you go about testing an on submit if a component does not have or require an onSubmit prop? I can think of multiple cases whereby we do not need to pass in prop for submitting a form - the component handles it itself. It therefore seems very counterintuitive and unrealistic to have to pass in a prop that is ONLY used for testing?