-
Notifications
You must be signed in to change notification settings - Fork 13
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
NJ 271 - fix when review screen displays health insurance section #5457
Conversation
Heroku app: https://gyr-review-app-5457-2e40f7315ce3.herokuapp.com/ |
@@ -23,7 +23,7 @@ | |||
</section> | |||
<% end %> | |||
|
|||
<% if current_intake.has_health_insurance_requirement_exception? || current_intake.eligibility_all_members_health_insurance_no? %> | |||
<% if current_intake.dependents.any? && (current_intake.has_health_insurance_requirement_exception? || current_intake.eligibility_all_members_health_insurance_no?) %> |
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.
is the second conditional necessary? If they answered no to the health insurance eligibility question, they either will be offboarded (and so will never get to the review screen) or they meet an exception
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.
That's a great catch -- it was in the previous code so not introduced here, but I suspect that if we took it out then tests would probably still pass and would be cleaner.
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.
After some digging, I think you're right! This second condition is redundant because anyone at this point would have been screened out if they answered yes and didn't have an exception. Truth table below to validate that the logic behaves identically:
current_intake.has_health_insurance_requirement_exception? || current_intake.eligibility_all_members_health_insurance_no?
Exception True, Insurance_no? True = conditional True
Exception False, Insurance_no? True - screened out
Exception True, Insurance_no? False = conditional True
Exception False, Insurance_no? False = conditional False
current_intake.has_health_insurance_requirement_exception?
Exception True, Insurance_no? True = conditional True
Exception False, Insurance_no? True - screened out
Exception True, Insurance_no? False = conditional True
Exception False, Insurance_no? False = conditional False
|
||
context 'when no dependents and gross income at threshold' do | ||
it 'does not show the dependents without health insurance block' do | ||
allow_any_instance_of(Efile::Nj::Nj1040Calculator).to receive(:calculate_line_29).and_return 20_000 |
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.
I'm not sure if this is a test or app functionality but just highlighting that the income threshold is just one of the exceptions to health insurance eligibility (the other being claimed as dependents on another return) and it's 20k for some filing statuses, 10k for others
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.
That is a good point - instead of getting into this or that reason for eligibility, which is all tested elsewhere, the mock here can have something like:
allow_any_instance_of(StateFileNjIntake).to receive(:eligibility_all_members_health_insurance_no?).and_return(false)
it 'does not show the dependents without health insurance block' do | ||
allow_any_instance_of(Efile::Nj::Nj1040Calculator).to receive(:calculate_line_29).and_return 20_000 | ||
get :edit | ||
expect(response.body).not_to have_text "Dependents who DO NOT have health insurance" |
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.
[pebble] - I think if we have this test, we should pair it with a test case for the opposite when we do expect the text
require "rails_helper" | ||
|
||
RSpec.describe StateFile::Questions::NjReviewController do | ||
let(:intake) { create :state_file_nj_intake, :df_data_minimal } |
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.
[dust] - should we use one of the more realistic profiles here? and then use mocks below as needed?
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.
Yeah, it's a good point - happy to make a new import for springsteen that represents no dependents.
@@ -29,14 +29,6 @@ | |||
expect(described_class.show?(intake)).to eq true | |||
end | |||
end | |||
|
|||
context "and did not have a health insurance requirement exception, but all members did not have health insurance" do |
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.
Test case would never happen as someone with no exceptions and who answered no to the eligibility question would be screened out.
vita-min/app/models/state_file_nj_intake.rb
Line 188 in d02c901
if self.eligibility_all_members_health_insurance_no? && !self.has_health_insurance_requirement_exception? |
trait :df_data_no_deps do | ||
raw_direct_file_data { StateFile::DirectFileApiResponseSampleService.new.read_xml('nj_springsteen_mfj') } | ||
raw_direct_file_intake_data { StateFile::DirectFileApiResponseSampleService.new.read_json('nj_springsteen_mfj') } | ||
primary_birth_date { Date.new(1990, 1, 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.
Have to add birth dates or EITC check fails when trying to check age of filer/spouse.
@@ -181,8 +173,6 @@ | |||
trait :df_data_no_deps do | |||
raw_direct_file_data { StateFile::DirectFileApiResponseSampleService.new.read_xml('nj_springsteen_mfj') } | |||
raw_direct_file_intake_data { StateFile::DirectFileApiResponseSampleService.new.read_json('nj_springsteen_mfj') } | |||
primary_birth_date { Date.new(1990, 1, 1) } | |||
spouse_birth_date { Date.new(1990, 1, 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.
Spouse birth date was not set because filing status was incorrectly set to single
.
head_of_household: 4, | ||
qualifying_widow: 5, | ||
}[evaluator.filing_status.to_sym] || evaluator.filing_status | ||
intake.direct_file_data.filing_status = numeric_status |
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.
This code would always override filing status to be single
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.
Moving this issue to a separate ticket: https://github.com/newjersey/affordability-pm/issues/279. Going to revert the logic for now, and use a persona with filing_status
single (nj_lucky_single) and no dependents for the test.
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.
thanks for making that follow-up ticket!
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
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.
looks good!
Link to pivotal/JIRA issue
Is PM acceptance required? (delete one)
Reminder: merge main into this branch and get green tests before merging to main
What was done?
vita-min/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb
Line 7 in da60492
How to test?
Screenshots (for visual changes)