From f3c7de1d0a2de7a5bd67e26ae8625ebf98bd2c30 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 27 Dec 2024 11:00:40 -0500 Subject: [PATCH 01/18] Start to separate dependent health insurance from eligibility --- ..._dependents_health_insurance_controller.rb | 21 +++++++ ...eligibility_health_insurance_controller.rb | 10 +--- .../nj_dependents_health_insurance_form.rb | 10 ++++ .../nj_eligibility_health_insurance_form.rb | 10 ---- .../state_file_nj_question_navigation.rb | 1 + .../edit.html.erb | 36 +++++++++++ .../edit.html.erb | 59 +++++-------------- ...j_dependents_health_insurance_form_spec.rb | 37 ++++++++++++ ..._eligibility_health_insurance_form_spec.rb | 33 ----------- spec/models/efile_error_spec.rb | 1 + 10 files changed, 123 insertions(+), 95 deletions(-) create mode 100644 app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb create mode 100644 app/forms/state_file/nj_dependents_health_insurance_form.rb create mode 100644 app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb create mode 100644 spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb diff --git a/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb b/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb new file mode 100644 index 0000000000..9e3ddc6dd9 --- /dev/null +++ b/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb @@ -0,0 +1,21 @@ +module StateFile + module Questions + class NjDependentsHealthInsuranceController < QuestionsController + + before_action -> { @filing_year = Rails.configuration.statefile_current_tax_year } + + def form_params + params + .fetch(:state_file_nj_dependents_health_insurance_form, {}) + .permit([ + { + dependents_attributes: [ + :id, + :nj_did_not_have_health_insurance, + ] + } + ]) + end + end + end +end \ No newline at end of file diff --git a/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb b/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb index ce85f1f0da..eb948db998 100644 --- a/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb +++ b/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb @@ -8,15 +8,7 @@ class NjEligibilityHealthInsuranceController < QuestionsController def form_params params .fetch(:state_file_nj_eligibility_health_insurance_form, {}) - .permit([ - :eligibility_all_members_health_insurance, - { - dependents_attributes: [ - :id, - :nj_did_not_have_health_insurance, - ] - } - ]) + .permit([:eligibility_all_members_health_insurance]) end end end diff --git a/app/forms/state_file/nj_dependents_health_insurance_form.rb b/app/forms/state_file/nj_dependents_health_insurance_form.rb new file mode 100644 index 0000000000..302b6b79d4 --- /dev/null +++ b/app/forms/state_file/nj_dependents_health_insurance_form.rb @@ -0,0 +1,10 @@ +module StateFile + class NjEligibilityHealthInsuranceForm < QuestionsForm + attr_accessor :dependents_attributes + delegate :dependents, to: :intake + + def save + @intake.update!(dependents_attributes: dependents_attributes.to_h) + end + end +end \ No newline at end of file diff --git a/app/forms/state_file/nj_eligibility_health_insurance_form.rb b/app/forms/state_file/nj_eligibility_health_insurance_form.rb index 5329f724c0..679c93e53d 100644 --- a/app/forms/state_file/nj_eligibility_health_insurance_form.rb +++ b/app/forms/state_file/nj_eligibility_health_insurance_form.rb @@ -1,21 +1,11 @@ module StateFile class NjEligibilityHealthInsuranceForm < QuestionsForm set_attributes_for :intake, :eligibility_all_members_health_insurance - attr_accessor :dependents_attributes - delegate :dependents, to: :intake validates :eligibility_all_members_health_insurance, presence: true def save @intake.update(attributes_for(:intake)) - if @intake.eligibility_all_members_health_insurance_no? - @intake.update!(dependents_attributes: dependents_attributes.to_h) - else - attributes_array = intake.dependents.map do |dependent| - { id: dependent.id, nj_did_not_have_health_insurance: 'no' } - end - @intake.update!(dependents_attributes: attributes_array) - end end end end \ No newline at end of file diff --git a/app/lib/navigation/state_file_nj_question_navigation.rb b/app/lib/navigation/state_file_nj_question_navigation.rb index f09752d232..11ae5c28c3 100644 --- a/app/lib/navigation/state_file_nj_question_navigation.rb +++ b/app/lib/navigation/state_file_nj_question_navigation.rb @@ -39,6 +39,7 @@ class StateFileNjQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::NjDisabledExemptionController), Navigation::NavigationStep.new(StateFile::Questions::NjVeteransExemptionController), Navigation::NavigationStep.new(StateFile::Questions::NjCollegeDependentsExemptionController), + Navigation::NavigationStep.new(StateFile::Questions::NjDependentsHealthInsuranceController), Navigation::NavigationStep.new(StateFile::Questions::NjMedicalExpensesController), Navigation::NavigationStep.new(StateFile::Questions::NjHouseholdRentOwnController), Navigation::NavigationStep.new(StateFile::Questions::NjHomeownerEligibilityController), diff --git a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb new file mode 100644 index 0000000000..107eeffe17 --- /dev/null +++ b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb @@ -0,0 +1,36 @@ +<% title = t(".title") %> + +<% content_for :page_title, title %> +<% content_for :card do %> +

<%= title %>

+ + <%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %> +
+
+
+ <%= t('.label_follow_up') %> +
+ <%= f.fields_for :dependents do |ff| %> + <% dependent = ff.object %> + <%= ff.cfa_checkbox( + :nj_did_not_have_health_insurance, + t(".dependent_label", name: dependent.full_name), + options: { checked_value: "yes", unchecked_value: "no" } + ) %> + <% end %> +
+
+
+
+ + <%# TODO REMOVE FROM YML FILES %> +
+ +
+

<%= t('.tax_household_description_html') %>

+
+
+ + <%= f.continue %> + <% end %> +<% end %> diff --git a/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb index 4fa1561175..bc21624cbb 100644 --- a/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb +++ b/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb @@ -6,43 +6,23 @@ <%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %>
-
-
- <%= f.cfa_radio_set( - :eligibility_all_members_health_insurance, - label_text: t(".label", filing_year: @filing_year), - collection: [ - { value: "yes", label: t("general.affirmative") }, - { - value: "no", - label: t("general.negative"), - input_html: { - "data-follow-up": "#household-members", - "aria-controls": "household-members" - } - }, - ], - ) %> +
+ <%= f.cfa_radio_set( + :eligibility_all_members_health_insurance, + label_text: t(".label", filing_year: @filing_year), + collection: [ + { value: "yes", label: t("general.affirmative") }, + { + value: "no", + label: t("general.negative"), + input_html: { + "data-follow-up": "#household-members", + "aria-controls": "household-members" + } + }, + ], + ) %>
- - <% if current_intake.dependents.any? %> - - <% end %> -
@@ -52,13 +32,6 @@
-
- -
-

<%= t('.tax_household_description_html') %>

-
-
- <%= f.continue %> <% end %> <% end %> diff --git a/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb b/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb new file mode 100644 index 0000000000..e0f761dbe0 --- /dev/null +++ b/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb @@ -0,0 +1,37 @@ +require 'rails_helper' + +RSpec.describe StateFile::NjDependentsHealthInsuranceForm do + let(:intake) { + create :state_file_nj_intake, + :df_data_two_deps + } + let(:first_dependent) { intake.dependents[0] } + let(:second_dependent) { intake.dependents[1] } + + describe "#save" do + context "when not all tax household members had health insurance" do + let(:valid_params) do + { + dependents_attributes: { + '0': { + id: first_dependent.id, + nj_did_not_have_health_insurance: 'yes' + }, + '1': { + id: second_dependent.id, + nj_did_not_have_health_insurance: 'no' + } + } + } + end + + it "saves the answers to the intake" do + form = described_class.new(intake, valid_params) + form.save + intake.reload + expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "yes" + expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" + end + end + end +end \ No newline at end of file diff --git a/spec/forms/state_file/nj_eligibility_health_insurance_form_spec.rb b/spec/forms/state_file/nj_eligibility_health_insurance_form_spec.rb index d02f976d21..17115724a7 100644 --- a/spec/forms/state_file/nj_eligibility_health_insurance_form_spec.rb +++ b/spec/forms/state_file/nj_eligibility_health_insurance_form_spec.rb @@ -3,11 +3,8 @@ RSpec.describe StateFile::NjEligibilityHealthInsuranceForm do let(:intake) { create :state_file_nj_intake, - :df_data_two_deps, eligibility_all_members_health_insurance: "unfilled" } - let(:first_dependent) { intake.dependents[0] } - let(:second_dependent) { intake.dependents[1] } describe "validations" do let(:invalid_params) do @@ -27,16 +24,6 @@ let(:valid_params) do { eligibility_all_members_health_insurance: "yes", - dependents_attributes: { - '0': { - id: first_dependent.id, - nj_did_not_have_health_insurance: 'yes' - }, - '1': { - id: second_dependent.id, - nj_did_not_have_health_insurance: 'no' - } - } } end @@ -46,30 +33,12 @@ intake.reload expect(intake.eligibility_all_members_health_insurance_yes?).to eq true end - - it "saves no for all dependents" do - form = described_class.new(intake, valid_params) - form.save - intake.reload - expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "no" - expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" - end end context "when not all tax household members had health insurance" do let(:valid_params) do { eligibility_all_members_health_insurance: "no", - dependents_attributes: { - '0': { - id: first_dependent.id, - nj_did_not_have_health_insurance: 'yes' - }, - '1': { - id: second_dependent.id, - nj_did_not_have_health_insurance: 'no' - } - } } end @@ -78,8 +47,6 @@ form.save intake.reload expect(intake.eligibility_all_members_health_insurance_yes?).to eq false - expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "yes" - expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" end end end diff --git a/spec/models/efile_error_spec.rb b/spec/models/efile_error_spec.rb index 7a8fcc6200..eebc0d5936 100644 --- a/spec/models/efile_error_spec.rb +++ b/spec/models/efile_error_spec.rb @@ -81,6 +81,7 @@ "nc-veteran-status", "nj-college-dependents-exemption", "nj-county", + "nj-dependents-health-insurance", "nj-disabled-exemption", "nj-eitc-qualifying-child", "nj-eligibility-health-insurance", From 5599f52ea3f5e7fe343efbd5d63f14e668a97c8b Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 27 Dec 2024 15:10:05 -0500 Subject: [PATCH 02/18] Add show methods to health insurance controllers --- ..._dependents_health_insurance_controller.rb | 5 ++ ...eligibility_health_insurance_controller.rb | 5 ++ app/models/state_file_nj_intake.rb | 7 +- ...ndents_health_insurance_controller_spec.rb | 90 +++++++++++++++++++ ...bility_health_insurance_controller_spec.rb | 86 ------------------ spec/models/state_file_nj_intake_spec.rb | 4 +- 6 files changed, 107 insertions(+), 90 deletions(-) create mode 100644 spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb diff --git a/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb b/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb index 9e3ddc6dd9..462cdc3db6 100644 --- a/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb +++ b/app/controllers/state_file/questions/nj_dependents_health_insurance_controller.rb @@ -4,6 +4,11 @@ class NjDependentsHealthInsuranceController < QuestionsController before_action -> { @filing_year = Rails.configuration.statefile_current_tax_year } + def self.show?(intake) + return false unless intake.dependents.any? + intake.has_health_insurance_requirement_exception? || intake.eligibility_all_members_health_insurance_no? + end + def form_params params .fetch(:state_file_nj_dependents_health_insurance_form, {}) diff --git a/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb b/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb index eb948db998..aa47417c67 100644 --- a/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb +++ b/app/controllers/state_file/questions/nj_eligibility_health_insurance_controller.rb @@ -5,11 +5,16 @@ class NjEligibilityHealthInsuranceController < QuestionsController before_action -> { @filing_year = Rails.configuration.statefile_current_tax_year } + def self.show?(intake) + !intake.has_health_insurance_requirement_exception? + end + def form_params params .fetch(:state_file_nj_eligibility_health_insurance_form, {}) .permit([:eligibility_all_members_health_insurance]) end + end end end \ No newline at end of file diff --git a/app/models/state_file_nj_intake.rb b/app/models/state_file_nj_intake.rb index dfe113af8b..f0602b99a4 100644 --- a/app/models/state_file_nj_intake.rb +++ b/app/models/state_file_nj_intake.rb @@ -184,10 +184,13 @@ def eligibility_made_less_than_threshold? nj_gross_income <= threshold end + def has_health_insurance_requirement_exception? + self.eligibility_made_less_than_threshold? || self.eligibility_claimed_as_dependent? + end + def health_insurance_eligibility if self.eligibility_all_members_health_insurance_no? - has_exception = self.eligibility_made_less_than_threshold? || self.eligibility_claimed_as_dependent? - has_exception ? "eligible" : "ineligible" + self.has_health_insurance_requirement_exception? ? "eligible" : "ineligible" else "eligible" end diff --git a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb new file mode 100644 index 0000000000..127bba696e --- /dev/null +++ b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb @@ -0,0 +1,90 @@ +require 'rails_helper' + +RSpec.describe StateFile::Questions::NjDependentsHealthInsuranceController do + describe "#update" do + context "taxpayer with dependents" do + let(:intake) { create :state_file_nj_intake, :df_data_two_deps } + let(:first_dependent) { intake.dependents[0] } + let(:second_dependent) { intake.dependents[1] } + + let(:form_params) do + { + state_file_nj_eligibility_health_insurance_form: { + dependents_attributes: { + '0': { + id: first_dependent.id, + nj_did_not_have_health_insurance: 'yes' + }, + '1': { + id: second_dependent.id, + nj_did_not_have_health_insurance: 'no' + } + } + } + } + end + + before do + sign_in intake + end + + render_views + it "succeeds" do + get :edit + expect(response).to be_successful + end + + it "shows all dependents" do + get :edit + expect(response.body).to include("Aphrodite") + expect(response.body).to include("Kronos") + end + + it "saves the checkbox selections" do + post :update, params: form_params + intake.reload + expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "yes" + expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" + end + end + + + context "when taxpayer with dependents affirms coverage when answer was previously no and they had indicated dependents without coverage" do + let(:intake) { create :state_file_nj_intake, :df_data_two_deps, eligibility_all_members_health_insurance: 'no' } + let(:first_dependent) { intake.dependents[0] } + let(:second_dependent) { intake.dependents[1] } + + let(:form_params) do + { + state_file_nj_eligibility_health_insurance_form: { + eligibility_all_members_health_insurance: "yes", + dependents_attributes: { + '0': { + id: first_dependent.id, + nj_did_not_have_health_insurance: 'yes' + }, + '1': { + id: second_dependent.id, + nj_did_not_have_health_insurance: 'yes' + } + } + } + } + end + + before do + sign_in intake + end + + it "sets all dependent values to no to indicate that they did indeed have coverage" do + first_dependent.nj_did_not_have_health_insurance = 'no' + second_dependent.nj_did_not_have_health_insurance = 'yes' + intake.reload + post :update, params: form_params + intake.reload + expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "no" + expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" + end + end + end +end \ No newline at end of file diff --git a/spec/controllers/state_file/questions/nj_eligibility_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_eligibility_health_insurance_controller_spec.rb index 53a163adc4..4826a3634c 100644 --- a/spec/controllers/state_file/questions/nj_eligibility_health_insurance_controller_spec.rb +++ b/spec/controllers/state_file/questions/nj_eligibility_health_insurance_controller_spec.rb @@ -36,91 +36,5 @@ expect(response).not_to redirect_to(controller: "state_file/questions/eligibility_offboarding", action: :edit) end end - - context "when taxpayer with dependents checks no" do - let(:intake) { create :state_file_nj_intake, :df_data_two_deps } - let(:first_dependent) { intake.dependents[0] } - let(:second_dependent) { intake.dependents[1] } - - let(:form_params) do - { - state_file_nj_eligibility_health_insurance_form: { - eligibility_all_members_health_insurance: "no", - dependents_attributes: { - '0': { - id: first_dependent.id, - nj_did_not_have_health_insurance: 'yes' - }, - '1': { - id: second_dependent.id, - nj_did_not_have_health_insurance: 'no' - } - } - } - } - end - - before do - sign_in intake - end - - render_views - it "succeeds" do - get :edit - expect(response).to be_successful - end - - it "shows all dependents" do - get :edit - expect(response.body).to include("Aphrodite") - expect(response.body).to include("Kronos") - end - - it "saves the checkbox selections" do - post :update, params: form_params - intake.reload - expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "yes" - expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" - end - end - - - context "when taxpayer with dependents affirms coverage when answer was previously no and they had indicated dependents without coverage" do - let(:intake) { create :state_file_nj_intake, :df_data_two_deps, eligibility_all_members_health_insurance: 'no' } - let(:first_dependent) { intake.dependents[0] } - let(:second_dependent) { intake.dependents[1] } - - let(:form_params) do - { - state_file_nj_eligibility_health_insurance_form: { - eligibility_all_members_health_insurance: "yes", - dependents_attributes: { - '0': { - id: first_dependent.id, - nj_did_not_have_health_insurance: 'yes' - }, - '1': { - id: second_dependent.id, - nj_did_not_have_health_insurance: 'yes' - } - } - } - } - end - - before do - sign_in intake - end - - it "sets all dependent values to no to indicate that they did indeed have coverage" do - first_dependent.nj_did_not_have_health_insurance = 'no' - second_dependent.nj_did_not_have_health_insurance = 'yes' - intake.reload - post :update, params: form_params - intake.reload - expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "no" - expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" - end - end end end \ No newline at end of file diff --git a/spec/models/state_file_nj_intake_spec.rb b/spec/models/state_file_nj_intake_spec.rb index 631115f9a5..255af377bb 100644 --- a/spec/models/state_file_nj_intake_spec.rb +++ b/spec/models/state_file_nj_intake_spec.rb @@ -193,7 +193,7 @@ shared_examples :eligibility_with_threshold do |threshold| it "returns true if NJ gross income below #{threshold}" do - allow(intake.calculator.lines).to receive(:[]).with(:NJ1040_LINE_29).and_return(double(value: threshold-1)) + allow(intake.calculator.lines).to receive(:[]).with(:NJ1040_LINE_29).and_return(double(value: threshold - 1)) expect(intake.eligibility_made_less_than_threshold?).to eq true end @@ -203,7 +203,7 @@ end it "returns false if NJ gross income over #{threshold}" do - allow(intake.calculator.lines).to receive(:[]).with(:NJ1040_LINE_29).and_return(double(value: threshold+1)) + allow(intake.calculator.lines).to receive(:[]).with(:NJ1040_LINE_29).and_return(double(value: threshold + 1)) expect(intake.eligibility_made_less_than_threshold?).to eq false end end From 8f08f4adaf46b0d547a99fef7bf5952b180173a3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 27 Dec 2024 16:18:46 -0500 Subject: [PATCH 03/18] Test dependents health insurance show --- ...ndents_health_insurance_controller_spec.rb | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb index 127bba696e..e13232de14 100644 --- a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb +++ b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb @@ -1,6 +1,43 @@ require 'rails_helper' RSpec.describe StateFile::Questions::NjDependentsHealthInsuranceController do + describe ".show?" do + context "when intake has no dependents" do + let(:intake) { create :state_file_nj_intake} + it "does not show" do + expect(described_class.show?(intake)).to eq false + end + end + + context "when intake has depedents" do + let(:intake) { create :state_file_nj_intake, :df_data_two_deps } + + context "and did not have a health insurance requirement exception and all members had health insurance" do + it "does not show" do + allow_any_instance_of(StateFileNjIntake).to receive(:has_health_insurance_requirement_exception?).and_return(false) + allow_any_instance_of(StateFileNjIntake).to receive(:eligibility_all_members_health_insurance_no?).and_return(false) + expect(described_class.show?(intake)).to eq false + end + end + + context "and had a health insurance requirement exception, and all members had health insurance" do + it "shows" do + allow_any_instance_of(StateFileNjIntake).to receive(:has_health_insurance_requirement_exception?).and_return(true) + allow_any_instance_of(StateFileNjIntake).to receive(:eligibility_all_members_health_insurance_no?).and_return(false) + 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 + it "shows" do + allow_any_instance_of(StateFileNjIntake).to receive(:has_health_insurance_requirement_exception?).and_return(false) + allow_any_instance_of(StateFileNjIntake).to receive(:eligibility_all_members_health_insurance_no?).and_return(true) + expect(described_class.show?(intake)).to eq true + end + end + end + end + describe "#update" do context "taxpayer with dependents" do let(:intake) { create :state_file_nj_intake, :df_data_two_deps } From fd59cf691321c372452f6d5b09aa9dee573352ed Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 30 Dec 2024 11:02:17 -0500 Subject: [PATCH 04/18] Correct form name --- .../nj_dependents_health_insurance_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb index e13232de14..e6c8ee6f98 100644 --- a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb +++ b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb @@ -46,7 +46,7 @@ let(:form_params) do { - state_file_nj_eligibility_health_insurance_form: { + state_file_nj_dependent_health_insurance_form: { dependents_attributes: { '0': { id: first_dependent.id, @@ -93,7 +93,7 @@ let(:form_params) do { - state_file_nj_eligibility_health_insurance_form: { + state_file_nj_dependent_health_insurance_form: { eligibility_all_members_health_insurance: "yes", dependents_attributes: { '0': { From 643bf8a03370614262de92b40565705df1f0616f Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 30 Dec 2024 11:12:30 -0500 Subject: [PATCH 05/18] Correct copy --- .../state_file/nj_dependents_health_insurance_form.rb | 2 +- .../nj_dependents_health_insurance/edit.html.erb | 9 ++++----- .../nj_eligibility_health_insurance/edit.html.erb | 2 +- config/locales/en.yml | 6 ++++++ config/locales/es.yml | 6 ++++++ 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/forms/state_file/nj_dependents_health_insurance_form.rb b/app/forms/state_file/nj_dependents_health_insurance_form.rb index 302b6b79d4..f7e7cb2bc8 100644 --- a/app/forms/state_file/nj_dependents_health_insurance_form.rb +++ b/app/forms/state_file/nj_dependents_health_insurance_form.rb @@ -1,5 +1,5 @@ module StateFile - class NjEligibilityHealthInsuranceForm < QuestionsForm + class NjDependentsHealthInsuranceForm < QuestionsForm attr_accessor :dependents_attributes delegate :dependents, to: :intake diff --git a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb index 107eeffe17..a24b36ca5d 100644 --- a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb +++ b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb @@ -8,13 +8,13 @@
- <%= t('.label_follow_up') %> + <%= t('.label') %>
<%= f.fields_for :dependents do |ff| %> <% dependent = ff.object %> <%= ff.cfa_checkbox( :nj_did_not_have_health_insurance, - t(".dependent_label", name: dependent.full_name), + dependent.full_name, options: { checked_value: "yes", unchecked_value: "no" } ) %> <% end %> @@ -23,11 +23,10 @@
- <%# TODO REMOVE FROM YML FILES %>
- +
-

<%= t('.tax_household_description_html') %>

+ <%= t('.coverage_description_html') %>
diff --git a/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb index bc21624cbb..52c1c68067 100644 --- a/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb +++ b/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb @@ -28,7 +28,7 @@
-

<%= t('.coverage_description_html') %>

+ <%= t('.coverage_description_html') %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index f7b49ba628..67f9d9c45f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3127,6 +3127,12 @@ en: edit: county: County title: Select the county where you lived on December 31, %{filing_year} + nj_dependents_health_insurance: + edit: + coverage_description_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" + coverage_heading: What is health insurance with minimum essential coverage? + label: 'Check all the people that did NOT have health insurance:' + title: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. nj_disabled_exemption: edit: instructions_html: People with disabilities are eligible for tax exemptions.

In NJ, you are considered disabled if you have a "total and permanent inability to engage in any substantial gainful activity because of any physical or mental impairment, including blindness."

(This is different from the federal tax definition. NJ doesn’t consider your age or your receipt of taxable disability income.) diff --git a/config/locales/es.yml b/config/locales/es.yml index 98c5145903..d1eb9f50f7 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3087,6 +3087,12 @@ es: edit: county: Condado title: Selecciona el condado donde viviste el 31 de diciembre de %{filing_year} + nj_dependents_health_insurance: + edit: + coverage_description_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" + coverage_heading: What is health insurance with minimum essential coverage? + label: 'Check all the people that did NOT have health insurance:' + title: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. nj_disabled_exemption: edit: instructions_html: Las personas con discapacidad tienen derecho a exenciones de impuestos.

En Nueva Jersey, se le considera discapacitado si tiene una "incapacidad total y permanente para participar en cualquier actividad sustancial y lucrativa debido a cualquier impedimento físico o mental, incluida la ceguera".

(Esto es diferente de la definición de impuestos federales. Nueva Jersey no tiene en cuenta su edad ni su percepción de ingresos por discapacidad sujetos a impuestos.) From c316a9abeef3c0f92d87d0a98429068b8e9fdad3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 11:13:27 -0500 Subject: [PATCH 06/18] Add advance health insurance eligibility to intake spec --- spec/features/state_file/complete_intake_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/features/state_file/complete_intake_spec.rb b/spec/features/state_file/complete_intake_spec.rb index ba58b76717..fbe00fdc6f 100644 --- a/spec/features/state_file/complete_intake_spec.rb +++ b/spec/features/state_file/complete_intake_spec.rb @@ -677,7 +677,9 @@ def advance_to_start_of_intake(df_persona_name) expect(page).to have_text I18n.t("state_file.questions.income_review.edit.title") continue + end + def advance_health_insurance_eligibility expect(page).to have_text I18n.t("state_file.questions.nj_eligibility_health_insurance.edit.title") choose I18n.t("general.affirmative") continue @@ -775,8 +777,9 @@ def expect_ineligible_page(property, reason) continue end - def advance_to_property_tax_page(df_persona_name) + def advance_to_property_tax_page(df_persona_name, skip_health_insurance_eligibility: false) advance_to_start_of_intake(df_persona_name) + advance_health_insurance_eligibility unless skip_health_insurance_eligibility advance_county_and_municipality advance_disabled_exemption advance_veterans_exemption @@ -785,7 +788,7 @@ def advance_to_property_tax_page(df_persona_name) it "advances past the loading screen by listening for an actioncable broadcast", required_schema: "nj" do - advance_to_property_tax_page("Minimal") + advance_to_property_tax_page("Minimal", skip_health_insurance_eligibility: true) choose_household_rent_own("neither") # estimated tax payments From 16f652645385d362c5fb7ce9e5161e01734e453e Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 12:07:34 -0500 Subject: [PATCH 07/18] Remove duplicate minimal essential coverage html --- .../nj_dependents_health_insurance/edit.html.erb | 2 +- .../nj_eligibility_health_insurance/edit.html.erb | 9 ++++++++- config/locales/en.yml | 5 +---- config/locales/es.yml | 5 +---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb index a24b36ca5d..8bd91a1246 100644 --- a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb +++ b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb @@ -26,7 +26,7 @@
- <%= t('.coverage_description_html') %> + <%= t('state_file.general.nj_minimal_essential_health_coverage_html') %>
diff --git a/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb index 52c1c68067..56ae021441 100644 --- a/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb +++ b/app/views/state_file/questions/nj_eligibility_health_insurance/edit.html.erb @@ -28,7 +28,14 @@
- <%= t('.coverage_description_html') %> + <%= t('state_file.general.nj_minimal_essential_health_coverage_html') %> +
+
+ +
+ +
+

<%= t('.tax_household_description_html') %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 67f9d9c45f..6a4ae1409f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2119,6 +2119,7 @@ en: nc_tax_withheld: North Carolina tax withheld nc_taxable_income: North Carolina taxable income nc_use_tax: North Carolina use tax + nj_minimal_essential_health_coverage_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" register_to_vote: Register to vote. see_detailed_return: See detailed return information standard_deduction: Standard deduction @@ -3129,7 +3130,6 @@ en: title: Select the county where you lived on December 31, %{filing_year} nj_dependents_health_insurance: edit: - coverage_description_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" coverage_heading: What is health insurance with minimum essential coverage? label: 'Check all the people that did NOT have health insurance:' title: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. @@ -3166,11 +3166,8 @@ en: title: You may be eligible for the Earned Income Tax Credit nj_eligibility_health_insurance: edit: - coverage_description_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" coverage_heading: What is health insurance with minimum essential coverage? - dependent_label: "%{name}" label: Did you and all members of your tax household have health insurance (with minimum essential coverage) for every month in %{filing_year}? - label_follow_up: Which dependents were missing health insurance? tax_household_description_html: A tax household includes you, your spouse (if filing a joint return), domestic partner claimed on your return, and any individuals you claim as dependents on your NJ-1040. It also includes any individuals you can, but do not, claim as dependents on your return. tax_household_heading: What is considered a tax household? title: Let’s get started. diff --git a/config/locales/es.yml b/config/locales/es.yml index d1eb9f50f7..19f2211826 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -2071,6 +2071,7 @@ es: nc_tax_withheld: Impuesto retenido en Carolina del Norte nc_taxable_income: Ingreso tributables en Carolina del Norte nc_use_tax: Impuesto sobre el uso de Carolina del Norte + nj_minimal_essential_health_coverage_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" register_to_vote: Regístrate para votar see_detailed_return: Ver información detallada de la declaración standard_deduction: Deducción estándar @@ -3089,7 +3090,6 @@ es: title: Selecciona el condado donde viviste el 31 de diciembre de %{filing_year} nj_dependents_health_insurance: edit: - coverage_description_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" coverage_heading: What is health insurance with minimum essential coverage? label: 'Check all the people that did NOT have health insurance:' title: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. @@ -3126,11 +3126,8 @@ es: title: You may be eligible for the Earned Income Tax Credit nj_eligibility_health_insurance: edit: - coverage_description_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" coverage_heading: What is health insurance with minimum essential coverage? - dependent_label: "%{name}" label: Did you and all members of your tax household have health insurance (with minimum essential coverage) for every month in %{filing_year}? - label_follow_up: Which dependents were missing health insurance? tax_household_description_html: A tax household includes you, your spouse (if filing a joint return), domestic partner claimed on your return, and any individuals you claim as dependents on your NJ-1040. It also includes any individuals you can, but do not, claim as dependents on your return. tax_household_heading: What is considered a tax household? title: Let’s get started. From 8c009d32cc32511489db410ec49186d1eff70991 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 13:18:51 -0500 Subject: [PATCH 08/18] update dependent birthdate in nj intake factory --- spec/factories/state_file_nj_intakes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/factories/state_file_nj_intakes.rb b/spec/factories/state_file_nj_intakes.rb index 9f8a54413a..96a3bb63e2 100644 --- a/spec/factories/state_file_nj_intakes.rb +++ b/spec/factories/state_file_nj_intakes.rb @@ -154,7 +154,7 @@ intake.synchronize_df_w2s_to_database intake.synchronize_df_dependents_to_database intake.dependents.each_with_index do |dependent, i| - dependent.update(dob: i.years.ago) + dependent.update(dob: Date.new(MultiTenantService.new(:statefile).current_tax_year - i, 1, 1)) end end From 433771b4336ec6a33e5894224411ecca5eb4a814 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 13:42:28 -0500 Subject: [PATCH 09/18] Use tax year in test --- .../submission_builder/ty2024/states/nj/nj_return_xml_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/submission_builder/ty2024/states/nj/nj_return_xml_spec.rb b/spec/lib/submission_builder/ty2024/states/nj/nj_return_xml_spec.rb index 4ae376b248..320a5b27fa 100644 --- a/spec/lib/submission_builder/ty2024/states/nj/nj_return_xml_spec.rb +++ b/spec/lib/submission_builder/ty2024/states/nj/nj_return_xml_spec.rb @@ -73,7 +73,7 @@ expect(xml.document.at('Dependents DependentsName FirstName').text).to eq("Kronos") expect(xml.document.at('Dependents DependentsName LastName').text).to eq("Athens") expect(xml.document.at('Dependents DependentsSSN').text).to eq("300000029") - expect(xml.document.at('Dependents BirthYear').text).to eq(Time.now.year.to_s) + expect(xml.document.at('Dependents BirthYear').text).to eq(MultiTenantService.new(:statefile).current_tax_year.to_s) end end From fe460342fa58bd2c25c5d6fe8abdf066cc2eeb79 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 13:52:31 -0500 Subject: [PATCH 10/18] Fix controller tests --- ...ndents_health_insurance_controller_spec.rb | 41 +------------------ 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb index e6c8ee6f98..bc036c67c2 100644 --- a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb +++ b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb @@ -46,7 +46,7 @@ let(:form_params) do { - state_file_nj_dependent_health_insurance_form: { + state_file_nj_dependents_health_insurance_form: { dependents_attributes: { '0': { id: first_dependent.id, @@ -84,44 +84,5 @@ expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" end end - - - context "when taxpayer with dependents affirms coverage when answer was previously no and they had indicated dependents without coverage" do - let(:intake) { create :state_file_nj_intake, :df_data_two_deps, eligibility_all_members_health_insurance: 'no' } - let(:first_dependent) { intake.dependents[0] } - let(:second_dependent) { intake.dependents[1] } - - let(:form_params) do - { - state_file_nj_dependent_health_insurance_form: { - eligibility_all_members_health_insurance: "yes", - dependents_attributes: { - '0': { - id: first_dependent.id, - nj_did_not_have_health_insurance: 'yes' - }, - '1': { - id: second_dependent.id, - nj_did_not_have_health_insurance: 'yes' - } - } - } - } - end - - before do - sign_in intake - end - - it "sets all dependent values to no to indicate that they did indeed have coverage" do - first_dependent.nj_did_not_have_health_insurance = 'no' - second_dependent.nj_did_not_have_health_insurance = 'yes' - intake.reload - post :update, params: form_params - intake.reload - expect(intake.dependents[0].nj_did_not_have_health_insurance).to eq "no" - expect(intake.dependents[1].nj_did_not_have_health_insurance).to eq "no" - end - end end end \ No newline at end of file From 99e4e4569e80d83e69629127edeff5041636aa02 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 14:37:08 -0500 Subject: [PATCH 11/18] Update dependents pdf test --- .../nj_additional_dependents_pdf_spec.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/lib/pdf_filler/nj_additional_dependents_pdf_spec.rb b/spec/lib/pdf_filler/nj_additional_dependents_pdf_spec.rb index 09bfe96628..bda0976386 100644 --- a/spec/lib/pdf_filler/nj_additional_dependents_pdf_spec.rb +++ b/spec/lib/pdf_filler/nj_additional_dependents_pdf_spec.rb @@ -30,34 +30,36 @@ end it 'fills dependents from XML after index 4 into the PDF' do + tax_year = MultiTenantService.new(:statefile).current_tax_year + expect(pdf_fields["Name_Row1"]).to eq "Underworld Hades" expect(pdf_fields["SSN_Row1"]).to eq "300000027" - expect(pdf_fields["BirthYear_Row1"]).to eq "#{4.years.ago.year}" + expect(pdf_fields["BirthYear_Row1"]).to eq (tax_year - 4).to_s expect(pdf_fields["HealthInsurance_Row1"]).to eq "Yes" expect(pdf_fields["Name_Row2"]).to eq "Thunder Ares" expect(pdf_fields["SSN_Row2"]).to eq "300000022" - expect(pdf_fields["BirthYear_Row2"]).to eq "#{5.years.ago.year}" + expect(pdf_fields["BirthYear_Row2"]).to eq (tax_year - 5).to_s expect(pdf_fields["HealthInsurance_Row2"]).to eq "Off" expect(pdf_fields["Name_Row3"]).to eq "Thunder Hercules" expect(pdf_fields["SSN_Row3"]).to eq "300000065" - expect(pdf_fields["BirthYear_Row3"]).to eq "#{6.years.ago.year}" + expect(pdf_fields["BirthYear_Row3"]).to eq (tax_year - 6).to_s expect(pdf_fields["HealthInsurance_Row3"]).to eq "Yes" expect(pdf_fields["Name_Row4"]).to eq "Archer Hermes" expect(pdf_fields["SSN_Row4"]).to eq "300000024" - expect(pdf_fields["BirthYear_Row4"]).to eq "#{7.years.ago.year}" + expect(pdf_fields["BirthYear_Row4"]).to eq (tax_year - 7).to_s expect(pdf_fields["HealthInsurance_Row4"]).to eq "Off" expect(pdf_fields["Name_Row5"]).to eq "Thunder Hebe" expect(pdf_fields["SSN_Row5"]).to eq "300000023" - expect(pdf_fields["BirthYear_Row5"]).to eq "#{8.years.ago.year}" + expect(pdf_fields["BirthYear_Row5"]).to eq (tax_year - 8).to_s expect(pdf_fields["HealthInsurance_Row5"]).to eq "Yes" expect(pdf_fields["Name_Row6"]).to eq "Wine Dionysus" expect(pdf_fields["SSN_Row6"]).to eq "300000068" - expect(pdf_fields["BirthYear_Row6"]).to eq "#{9.years.ago.year}" + expect(pdf_fields["BirthYear_Row6"]).to eq (tax_year - 9).to_s expect(pdf_fields["HealthInsurance_Row6"]).to eq "Off" end end From 850d74f58dabff42dd1dd1c0a63ca22fecc59875 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 15:37:16 -0500 Subject: [PATCH 12/18] Improve tests --- .../nj_dependents_health_insurance_controller_spec.rb | 6 ++++-- .../state_file/nj_dependents_health_insurance_form_spec.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb index bc036c67c2..3e8199db46 100644 --- a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb +++ b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb @@ -2,9 +2,11 @@ RSpec.describe StateFile::Questions::NjDependentsHealthInsuranceController do describe ".show?" do - context "when intake has no dependents" do - let(:intake) { create :state_file_nj_intake} + context "when intake has no dependents but would otherwise meet the criteria to show the controller" do + let(:intake) { create :state_file_nj_intake, :df_data_minimal} it "does not show" do + allow_any_instance_of(StateFileNjIntake).to receive(:has_health_insurance_requirement_exception?).and_return(true) + allow_any_instance_of(StateFileNjIntake).to receive(:eligibility_all_members_health_insurance_no?).and_return(true) expect(described_class.show?(intake)).to eq false end end diff --git a/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb b/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb index e0f761dbe0..7376bd4ddd 100644 --- a/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb +++ b/spec/forms/state_file/nj_dependents_health_insurance_form_spec.rb @@ -9,7 +9,7 @@ let(:second_dependent) { intake.dependents[1] } describe "#save" do - context "when not all tax household members had health insurance" do + context "when not all dependents had health insurance" do let(:valid_params) do { dependents_attributes: { From 094926bbadfcf725139341da90d660fba7a9f308 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Jan 2025 15:42:03 -0500 Subject: [PATCH 13/18] Remove unused css --- app/assets/stylesheets/_state-file.scss | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/assets/stylesheets/_state-file.scss b/app/assets/stylesheets/_state-file.scss index c1655a7bbe..682adf4679 100644 --- a/app/assets/stylesheets/_state-file.scss +++ b/app/assets/stylesheets/_state-file.scss @@ -312,19 +312,6 @@ font-size: 1.3rem; line-height: 1.9rem; } - - &.grey-group { - margin: 0 auto; - padding: 2rem; - margin-bottom: 2rem; - background: $color-grey-light; - border: 2px solid $color-grey-medium-light; - border-radius: 6px; - - .checkbox.is-selected { - background: inherit; - } - } } .form1099__label { From f3b4058bfdf214b104f40839f976a4f332e40bc9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 6 Jan 2025 09:59:46 -0500 Subject: [PATCH 14/18] PR comments --- app/models/state_file_nj_intake.rb | 7 ++++--- config/locales/en.yml | 11 ++++++++++- config/locales/es.yml | 11 ++++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/models/state_file_nj_intake.rb b/app/models/state_file_nj_intake.rb index f0602b99a4..6bccd5574a 100644 --- a/app/models/state_file_nj_intake.rb +++ b/app/models/state_file_nj_intake.rb @@ -189,10 +189,11 @@ def has_health_insurance_requirement_exception? end def health_insurance_eligibility - if self.eligibility_all_members_health_insurance_no? - self.has_health_insurance_requirement_exception? ? "eligible" : "ineligible" - else + if self.eligibility_all_members_health_insurance_yes? || + self.has_health_insurance_requirement_exception? "eligible" + else + "ineligible" end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 6a4ae1409f..f58678189a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2119,7 +2119,16 @@ en: nc_tax_withheld: North Carolina tax withheld nc_taxable_income: North Carolina taxable income nc_use_tax: North Carolina use tax - nj_minimal_essential_health_coverage_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" + nj_minimal_essential_health_coverage_html: |- +

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

+
    +
  • A plan through your employer
  • +
  • A plan bought through GetCoveredNJ
  • +
  • Medicare
  • +
  • Medicaid (NJ FamilyCare)
  • +
+

Here is the full list of insurance options that have minimum essential coverage.

+

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

register_to_vote: Register to vote. see_detailed_return: See detailed return information standard_deduction: Standard deduction diff --git a/config/locales/es.yml b/config/locales/es.yml index 19f2211826..514f0b0250 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -2071,7 +2071,16 @@ es: nc_tax_withheld: Impuesto retenido en Carolina del Norte nc_taxable_income: Ingreso tributables en Carolina del Norte nc_use_tax: Impuesto sobre el uso de Carolina del Norte - nj_minimal_essential_health_coverage_html: "

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

\n
    \n
  • A plan through your employer
  • \n
  • A plan bought through GetCoveredNJ
  • \n
  • Medicare
  • \n
  • Medicaid (NJ FamilyCare)
  • \n
\n

Here is the full list of insurance options that have minimum essential coverage.

\n

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

\n" + nj_minimal_essential_health_coverage_html: |- +

Most people who have health insurance have minimum essential coverage. “Minimal essential coverage” just refers to how much your plan covers. If you have any of the following, you most likely have it:

+
    +
  • A plan through your employer
  • +
  • A plan bought through GetCoveredNJ
  • +
  • Medicare
  • +
  • Medicaid (NJ FamilyCare)
  • +
+

Here is the full list of insurance options that have minimum essential coverage.

+

If you only had standalone vision and dental plans, workers' compensation coverage, and/or coverage limited to a specified disease or illness, you didn't have minimum essential coverage. In New Jersey, as of 2018, you need minimum essential coverage, or you will likely pay additional taxes.

register_to_vote: Regístrate para votar see_detailed_return: Ver información detallada de la declaración standard_deduction: Deducción estándar From 155fe647b18fa0cb0d1b86d36308bb7d0bc17a59 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 6 Jan 2025 13:11:54 -0500 Subject: [PATCH 15/18] Fix health insurance eligibilty logic error --- app/models/state_file_nj_intake.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/state_file_nj_intake.rb b/app/models/state_file_nj_intake.rb index 6bccd5574a..eae3b1c00a 100644 --- a/app/models/state_file_nj_intake.rb +++ b/app/models/state_file_nj_intake.rb @@ -189,12 +189,10 @@ def has_health_insurance_requirement_exception? end def health_insurance_eligibility - if self.eligibility_all_members_health_insurance_yes? || - self.has_health_insurance_requirement_exception? - "eligible" - else - "ineligible" + if self.eligibility_all_members_health_insurance_no? && !self.has_health_insurance_requirement_exception? + return "ineligible" end + "eligible" end def disqualifying_eligibility_rules From c1afd56b686f86c7b62b08055e7313d46aec09fd Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 6 Jan 2025 13:38:24 -0500 Subject: [PATCH 16/18] Fix typo --- .../questions/nj_dependents_health_insurance_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb index 3e8199db46..fb827680a7 100644 --- a/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb +++ b/spec/controllers/state_file/questions/nj_dependents_health_insurance_controller_spec.rb @@ -11,7 +11,7 @@ end end - context "when intake has depedents" do + context "when intake has dependents" do let(:intake) { create :state_file_nj_intake, :df_data_two_deps } context "and did not have a health insurance requirement exception and all members had health insurance" do From a9da7b3a653c97c9d8a833d9b35db22a59842c3d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 6 Jan 2025 14:12:16 -0500 Subject: [PATCH 17/18] Fix copy and spacing --- .../edit.html.erb | 31 +++++++++---------- config/locales/en.yml | 4 ++- config/locales/es.yml | 4 ++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb index 8bd91a1246..d0dab47c56 100644 --- a/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb +++ b/app/views/state_file/questions/nj_dependents_health_insurance/edit.html.erb @@ -1,4 +1,4 @@ -<% title = t(".title") %> +<% title = t(".title_html") %> <% content_for :page_title, title %> <% content_for :card do %> @@ -6,23 +6,22 @@ <%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %>
-
-
- <%= t('.label') %> -
- <%= f.fields_for :dependents do |ff| %> - <% dependent = ff.object %> - <%= ff.cfa_checkbox( - :nj_did_not_have_health_insurance, - dependent.full_name, - options: { checked_value: "yes", unchecked_value: "no" } - ) %> - <% end %> -
-
-
+
+ <%= t('.label') %> +
+ <%= f.fields_for :dependents do |ff| %> + <% dependent = ff.object %> + <%= ff.cfa_checkbox( + :nj_did_not_have_health_insurance, + dependent.full_name, + options: { checked_value: "yes", unchecked_value: "no" } + ) %> + <% end %> +
+
+

<%= t('.continue') %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index f58678189a..03708c887b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3139,9 +3139,11 @@ en: title: Select the county where you lived on December 31, %{filing_year} nj_dependents_health_insurance: edit: + continue: Click "continue" if all these people had health insurance. coverage_heading: What is health insurance with minimum essential coverage? label: 'Check all the people that did NOT have health insurance:' - title: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. + title_html: "Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024." nj_disabled_exemption: edit: instructions_html: People with disabilities are eligible for tax exemptions.

In NJ, you are considered disabled if you have a "total and permanent inability to engage in any substantial gainful activity because of any physical or mental impairment, including blindness."

(This is different from the federal tax definition. NJ doesn’t consider your age or your receipt of taxable disability income.) diff --git a/config/locales/es.yml b/config/locales/es.yml index 514f0b0250..f02274a7eb 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3099,9 +3099,11 @@ es: title: Selecciona el condado donde viviste el 31 de diciembre de %{filing_year} nj_dependents_health_insurance: edit: + continue: Click "continue" if all these people had health insurance. coverage_heading: What is health insurance with minimum essential coverage? label: 'Check all the people that did NOT have health insurance:' - title: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. + title_html: "Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024." nj_disabled_exemption: edit: instructions_html: Las personas con discapacidad tienen derecho a exenciones de impuestos.

En Nueva Jersey, se le considera discapacitado si tiene una "incapacidad total y permanente para participar en cualquier actividad sustancial y lucrativa debido a cualquier impedimento físico o mental, incluida la ceguera".

(Esto es diferente de la definición de impuestos federales. Nueva Jersey no tiene en cuenta su edad ni su percepción de ingresos por discapacidad sujetos a impuestos.) From c7ddc95bbf391e3657150ec2a3baf9b9bab00230 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 6 Jan 2025 14:30:28 -0500 Subject: [PATCH 18/18] Normalize i18n --- config/locales/en.yml | 3 +-- config/locales/es.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 03708c887b..1de35d888f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3142,8 +3142,7 @@ en: continue: Click "continue" if all these people had health insurance. coverage_heading: What is health insurance with minimum essential coverage? label: 'Check all the people that did NOT have health insurance:' - title_html: "Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024." + title_html: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. nj_disabled_exemption: edit: instructions_html: People with disabilities are eligible for tax exemptions.

In NJ, you are considered disabled if you have a "total and permanent inability to engage in any substantial gainful activity because of any physical or mental impairment, including blindness."

(This is different from the federal tax definition. NJ doesn’t consider your age or your receipt of taxable disability income.) diff --git a/config/locales/es.yml b/config/locales/es.yml index f02274a7eb..419ccb0729 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3102,8 +3102,7 @@ es: continue: Click "continue" if all these people had health insurance. coverage_heading: What is health insurance with minimum essential coverage? label: 'Check all the people that did NOT have health insurance:' - title_html: "Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024." + title_html: Please tell us which dependents were missing health insurance (with minimum essential health coverage) in 2024. nj_disabled_exemption: edit: instructions_html: Las personas con discapacidad tienen derecho a exenciones de impuestos.

En Nueva Jersey, se le considera discapacitado si tiene una "incapacidad total y permanente para participar en cualquier actividad sustancial y lucrativa debido a cualquier impedimento físico o mental, incluida la ceguera".

(Esto es diferente de la definición de impuestos federales. Nueva Jersey no tiene en cuenta su edad ni su percepción de ingresos por discapacidad sujetos a impuestos.)