-
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 243 - Add headers to review screen #5563
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -261,11 +261,21 @@ def check_xml_results | |||||||
|
||||||||
expect(page).to be_axe_clean.within "main" | ||||||||
|
||||||||
groups = page.all(:css, '.white-group').count | ||||||||
h2s = page.all(:css, 'h2').count | ||||||||
expect(groups).to eq(h2s - 2) | ||||||||
# total should be h2s -1 to account for the h2 reveal button | ||||||||
# there's also an extra h2 in the veteran exemption box | ||||||||
household_details_h3s = 2 + dependents_dob | ||||||||
income_details_h3s = 0 | ||||||||
dependents_attending_college_h3s = 1 | ||||||||
where_you_lived_as_of_dec_31_h3s = 1 | ||||||||
disability_exemption_h3s = 1 | ||||||||
veterans_exemption_h3s = 2 | ||||||||
medical_expenses_h3s = 1 | ||||||||
property_tax_h3s = 1 | ||||||||
payments_made_h3s = 1 | ||||||||
use_tax_h3s = 1 | ||||||||
reveal_h3 = 1 | ||||||||
total_expected_h3s = household_details_h3s + income_details_h3s + dependents_attending_college_h3s + where_you_lived_as_of_dec_31_h3s + disability_exemption_h3s + veterans_exemption_h3s + medical_expenses_h3s + property_tax_h3s + payments_made_h3s + use_tax_h3s + reveal_h3 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pebble ] The purpose of the test before was to make sure every white-group section box began with an h2, for consistent structure. Hence comparing the number of h2s to the number of white group boxes. Now that we're beginning boxes with h3s instead, I think it makes sense to check that structure instead of just counting elements. Maybe checking that each white group has at least one h3? And that it comes before any other content? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ agree that just checking the totals (white groups = h3s) makes more sense. this looks like it's checking that each section has an h3 but since it just adds them up in the end it's actually not a very specific test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue with the previous test is that not every white group on the page starts with a single h3 heading. Examples:
The previous test (white-groups=h2s) was not testing what we wanted to test , since I started trying to modify the math to make it work, but with all the cases above, it seemed much more readable to just assert what I expected for each section. Happy to explore other options if folks have suggestions, but just pulling the # of white groups and trying to modify that to match the number of h3s required a lot of arithmetic that seemed really opaque. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just read Melanie's comment more closely and found the suggestion to check for the presence of a header before any other content in the white-group, which would make a lot more sense here rather than just asserting that every white-group has an h3. Exploring that solution now! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use consistent heading structure, and the visual appearance should reflect the markup. It doesn't make sense to start some white groups with h2s and others with h3s-- all of the content should be broken into sections if any of it is. The design might need to be tweaked if this isn't currently possible |
||||||||
|
||||||||
h3s = page.all(:css, 'h3').count | ||||||||
expect(total_expected_h3s).to eq(h3s) | ||||||||
|
||||||||
edit_buttons = page.all(:css, '.white-group a') | ||||||||
edit_buttons_count = edit_buttons.count | ||||||||
|
@@ -569,7 +579,7 @@ def expect_municipality_question_hidden | |||||||
expect_municipality_question_exists | ||||||||
|
||||||||
# unselect county | ||||||||
within find('#county-question') do | ||||||||
within find_by_id('county-question') do | ||||||||
select I18n.t('general.select_prompt') | ||||||||
end | ||||||||
expect_county_question_exists | ||||||||
|
@@ -580,7 +590,7 @@ def expect_municipality_question_hidden | |||||||
advance_to_start_of_intake("Minimal", expect_income_review: false) | ||||||||
|
||||||||
select "Atlantic" | ||||||||
within find('#municipality-question') do | ||||||||
within find_by_id('municipality-question') do | ||||||||
expect(page.all("option").length).to eq(24) # 23 municipalities + 1 "- Select -" | ||||||||
expect(page).to have_text "Absecon City" | ||||||||
expect(page).to have_text "Atlantic City" | ||||||||
|
@@ -589,7 +599,7 @@ def expect_municipality_question_hidden | |||||||
end | ||||||||
|
||||||||
select "Mercer" | ||||||||
within find('#municipality-question') do | ||||||||
within find_by_id('municipality-question') do | ||||||||
expect(page.all("option").length).to eq(13) # 12 municipalities + 1 "- Select -" | ||||||||
expect(page).to have_text "East Windsor Township" | ||||||||
expect(page).to have_text "Hopewell Township" | ||||||||
|
@@ -602,10 +612,10 @@ def expect_municipality_question_hidden | |||||||
|
||||||||
select "Atlantic" | ||||||||
select "Absecon City" | ||||||||
expect(find("#state_file_nj_county_municipality_form_municipality_code").value).to eq("0101") | ||||||||
expect(find_by_id('state_file_nj_county_municipality_form_municipality_code').value).to eq("0101") | ||||||||
|
||||||||
select "Mercer" | ||||||||
expect(find("#state_file_nj_county_municipality_form_municipality_code").value).to eq("") | ||||||||
expect(find_by_id('state_file_nj_county_municipality_form_municipality_code').value).to eq("") | ||||||||
end | ||||||||
|
||||||||
end | ||||||||
|
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.
[a mound of pebbles] - looks like the
h2
->h3
change was only on the opening tag and not on the closing one. And that seems to apply to all the changes in this PR. it might still render correctly in browsers and test drivers which would hide the issue, but we should fix it