-
-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: The first part of the new Casa Case form does not save certain input on error #5785
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tests for this view https://github.com/rubyforgood/casa/blob/d539d06d8b3e1a07dec148be270ff7c1403e2d84/spec/system/casa_cases/new_spec.rb
I would love if you could add the small modification you made to one of the specs that checks for errors to ensure we don't have a regression in the future 🙂
@@ -54,6 +54,8 @@ def create | |||
format.json { render json: @casa_case, status: :created } | |||
end | |||
else | |||
set_contact_types | |||
@empty_court_date = params[:casa_case][:empty_court_date] == "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the helper court_date_unknown?
instead.
I did some modification, please review |
@iamronakgupta 1 last small thing. If I set the The checkbox being ticked should hide the date picker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What github issue is this PR for, if any?
Resolves #5760
What changed, and why?
Fixed values for "I don't know court date" and contact types all get cleared when there is error in form
How is this tested? (please write tests!) 💖💪
Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system
Screenshots please :)
Feelings gif (optional)
What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:
![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)