|
|
@ -106,10 +106,15 @@ RSpec.describe "Test Features" do |
|
|
|
|
|
|
|
|
|
|
|
it "shows conditional questions if the required answer is selected and hides it again when a different answer option is selected", js: true do |
|
|
|
it "shows conditional questions if the required answer is selected and hides it again when a different answer option is selected", js: true do |
|
|
|
visit("/case_logs/#{id}/armed_forces") |
|
|
|
visit("/case_logs/#{id}/armed_forces") |
|
|
|
find(:xpath, "//label[@for='armed-forces-0-field']").click |
|
|
|
# Someting about our styling makes the selenium webdriver think the actual radio buttons are not visible so we allow label click here |
|
|
|
|
|
|
|
choose("armed-forces-0-field", allow_label_click: true) |
|
|
|
expect(page).to have_selector("#armed_forces_injured_div") |
|
|
|
expect(page).to have_selector("#armed_forces_injured_div") |
|
|
|
find(:xpath, "//label[@for='armed-forces-2-field']").click |
|
|
|
choose("armed-forces-injured-1-field", allow_label_click: true) |
|
|
|
|
|
|
|
expect(find_field("armed-forces-injured-1-field", visible: false).checked?).to be_truthy |
|
|
|
|
|
|
|
choose("armed-forces-2-field", allow_label_click: true) |
|
|
|
expect(page).not_to have_selector("#armed_forces_injured_div") |
|
|
|
expect(page).not_to have_selector("#armed_forces_injured_div") |
|
|
|
|
|
|
|
choose("armed-forces-0-field", allow_label_click: true) |
|
|
|
|
|
|
|
expect(find_field("armed-forces-injured-1-field", visible: false).checked?).to be_falsey |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|