Skip to content
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 193 - Add none of the above option to property tax #5295

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

jachan
Copy link
Contributor

@jachan jachan commented Dec 26, 2024

Link to pivotal/JIRA issue

Is PM acceptance required? (delete one)

  • Yes - don't merge until JIRA issue is accepted!

Reminder: merge main into this branch and get green tests before merging to main

What was done?

  • Add None of the Above checkbox to tenant and homeowner property tax eligibility
  • None of the Above unchecks all other checkboxes when selected
  • If none of the above is checked, and user checks another checkbox, none of the above becomes unchecked
  • Moved NJ End to End tests to its own file, as it was getting very large (~400 lines out of a 1000 line test)

How to test?

  • Describe the testing approach taken to verify the changes, including:
    • Local Tests
      • Select "Lauryn MFS" (this allows an additional checkbox to appear for spouse)
        • Navigate to Property Tax, select Tenant or Homeowner
        • Validate that None of the Above behavior is as expected
    • Added end-to-end tests

Screenshots (for visual changes)

  • Before
image
  • After
NJ.203.After.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed what appeared to be an empty test file.

def advance_to_property_tax_page(df_persona_name)
advance_to_start_of_intake(df_persona_name)
advance_county_and_municipality
if has_text? I18n.t("state_file.questions.nj_disabled_exemption.edit.title")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made these conditional, as not all personas are asked about Disability (e.g. if Federal XML claims blindness, we take this exemption for them)

advance_disabled_exemption
end
advance_veterans_exemption
if has_text? I18n.t("state_file.questions.nj_college_dependents_exemption.edit.title")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, only personas with dependents are shown this controller, so made this conditional as well

expect_estimated_tax_page
end

it "handles homeowner none of the above checkbox", required_schema: "nj" do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test added here for homeowner none of the above

expect_estimated_tax_page
end

it "handles tenant none of the above checkbox", required_schema: "nj" do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test added here for tenant none of the above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented on changes, as moving all NJ tests out to a separate file makes it difficult to see what was modified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separating this out is a big improvement!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree! i think over future PRs it would be useful to separate out even more, so that this file really is just the minimal steps for a "complete intake" and then we can get into the weeds on edge cases in other places... but that can be done later

Copy link

Heroku app: https://gyr-review-app-5295-9b59a84ef4f5.herokuapp.com/
View logs: heroku logs --app gyr-review-app-5295 (optionally add --tail)

continue
end

def select_homeowner_eligibility(checkboxes, continue_to_next: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this helper function and the one below by adding continue_to_next

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern will be useful for a11y testing too!

Copy link
Contributor

@mmazanec22 mmazanec22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Non-blocking refactor suggestion

@@ -65,4 +70,36 @@

<%= f.continue %>
<% end %>
<% end %>
<script>
document.addEventListener("DOMContentLoaded", function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pebble] Seeing that we're using the same logic twice, I wonder if it's worth adding the function passed to the event listener to `app/javascript. You could refactor it to work for both cases by passing in the IDs of all not-none checkboxes, for each id adding the checkbox to the checkbox array if they're not null, passing in the noneCheckbox ID, and then optional checkbox ids that should be hidden when none is checked

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like this suggestion too. we or other states might need this pattern in more places so it would be handy to reuse

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separating this out is a big improvement!

continue
end

def select_homeowner_eligibility(checkboxes, continue_to_next: true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern will be useful for a11y testing too!

Copy link
Contributor

@mluedke2 mluedke2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! thanks for sorting tests too

Copy link
Member

@mpidcock mpidcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[dust] I like that you separated this out! something to be cautious of is that these journey tests that walk through an entire intake are the longest running tests we have. we tend to use the "complete intake" spec to cover only the minimum flow to ensure all pages can load and in the right sequence.

for less common/more complex pages you could consider splitting them out into a separate journey test, such as this grocery credit page in idaho.

Copy link
Contributor

@mrotondo mrotondo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this looks good, and should have a followup PR to refactor the duplicated code into a separate JS file.

@jachan jachan force-pushed the nj-193-property-tax-none branch from 3021c6f to 42921f0 Compare January 9, 2025 17:55
@jachan
Copy link
Contributor Author

jachan commented Jan 9, 2025

Rebased onto main, created separate followup ticket for refactor: https://github.com/newjersey/affordability-pm/issues/245. Planning to merge if all tests are green!

@jachan jachan force-pushed the nj-193-property-tax-none branch from 42921f0 to 705f918 Compare January 9, 2025 21:09
@jachan jachan merged commit a751e35 into main Jan 9, 2025
7 checks passed
@jachan jachan deleted the nj-193-property-tax-none branch January 9, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants