Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

ReportIncident save button always rendered #2548

Open
codyarose opened this issue Jan 15, 2021 · 8 comments 路 May be fixed by #2567
Open

ReportIncident save button always rendered #2548

codyarose opened this issue Jan 15, 2021 · 8 comments 路 May be fixed by #2567
Assignees
Labels
馃悰bug issue/pull request that documents/fixes a bug incidents needs requirements indicates that an issue needs more requirements in order to be worked on
Projects
Milestone

Comments

@codyarose
Copy link
Contributor

codyarose commented Jan 15, 2021

馃悰 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.

#2516 (comment)

To Reproduce

Uncomment the test and run npm t

Expected behavior

Test passes

@blestab blestab added incidents needs requirements indicates that an issue needs more requirements in order to be worked on 馃悰bug issue/pull request that documents/fixes a bug labels Jan 25, 2021
@blestab blestab added this to To do in Version 2.0 via automation Jan 25, 2021
@blestab blestab added this to the v2.0 milestone Jan 25, 2021
@blestab
Copy link
Contributor

blestab commented Jan 25, 2021

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 ?

@Adarsh710
Copy link
Contributor

@blestab I would like to take this up

@matteovivona
Copy link
Contributor

@Adarsh710 sure

@Adarsh710
Copy link
Contributor

@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?

@matteovivona
Copy link
Contributor

@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?

@Adarsh710
Copy link
Contributor

@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

@matteovivona
Copy link
Contributor

So let's fallback on that

Adarsh710 added a commit to Adarsh710/hospitalrun-frontend that referenced this issue Feb 13, 2021
@Adarsh710 Adarsh710 linked a pull request Feb 13, 2021 that will close this issue
@Adarsh710
Copy link
Contributor

@blestab, @tehkapa please assign reviewers to the above PR because I'm not able to do that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
馃悰bug issue/pull request that documents/fixes a bug incidents needs requirements indicates that an issue needs more requirements in order to be worked on
Projects
Version 2.0
  
To do
Development

Successfully merging a pull request may close this issue.

4 participants