ReportIncident save button always rendered
🐛 Bug Report
In ReportIncident.test.tsx there is a test implying that the save button should only be rendered after all required inputs are filled out, however the save button is always rendered regardless of input values, so the test will always fail. It may be because the Date of Incident input is prefilled with the current date/time, but in the staging app if you empty that input the page crashes.
https://github.com/HospitalRun/hospitalrun-frontend/pull/2516#discussion_r557076908
To Reproduce
Uncomment the test and run npm t
Expected behavior
Test passes
Thanks for this @codyarose
In ReportIncident.test.tsx there is a test implying that the save button should only be rendered after all required inputs are filled out, however the save button is always rendered regardless of input values, so the test will always fail.
Agreed, the test will always fail. I am not sure if that test is valid since the 'save' buttons in all forms are currently always rendered regardless of whether or not the fields are filled in
@jackcmeyer thoughts?
in the staging app if you empty that input the page crashes
This is a bug that needs addressing, would you like to take a shot at it @codyarose ?
@blestab I would like to take this up
@Adarsh710 sure
@tehKapa If the input is empty and has focus then the user can enter a date and if not, then previous date will appear, is this a good flow?
@tehKapa If the input is empty and has focus then the user can enter a date and if not, then previous date will appear, is this a good flow?
If initial value was empty, how do you want to populate it? With the current date?
@tehKapa If the input is empty and has focus then the user can enter a date and if not, then previous date will appear, is this a good flow?
If initial value was empty, how do you want to populate it? With the current date?
Yes, btw it is already populated with current date on initial render
So let's fallback on that
@blestab, @tehKapa please assign reviewers to the above PR because I'm not able to do that