Skip to content

Commit

Permalink
AP-5592: refactor downcasing of selector names
Browse files Browse the repository at this point in the history
Rather than downcase each interpolated value, downcase the entire
selector name
  • Loading branch information
colinbruce committed Dec 18, 2024
1 parent be389de commit fb1036e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions features/step_definitions/check_provider_answers_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
end

Then("the {string} proceeding check your answers section should contain:") do |proceeding_code, table|
expect_questions_and_answers_in(selector: "##{proceeding_code.downcase}-questions", expected: table)
expect_questions_and_answers_in(selector: "##{proceeding_code}-questions".downcase, expected: table)
end

Then(/^the (.*) answer for the (.*) proceeding (should|should not) match (.*)$/) do |question, proceeding_code, match, regex|
selector = "##{proceeding_code.downcase}-questions"
selector = "##{proceeding_code}-questions".downcase
answer = Regexp.new(regex)
within(selector) do
expect(page).to have_css("dt", text: question), "expected to find tag \"dt\" with text: \"#{question}\""
Expand All @@ -68,8 +68,8 @@
end

Then(/^the (emergency|substantive) scope limitation (.*) heading for (.*) should (be|not be) bold$/) do |type, text, proceeding_code, match|
within("##{proceeding_code.downcase}-questions") do
within("#app-check-your-answers__#{proceeding_code.downcase}_#{type}_scope_limitations") do
within("##{proceeding_code}-questions".downcase) do
within("#app-check-your-answers__#{proceeding_code}_#{type}_scope_limitations".downcase) do
if match == "be"
expect(page).to have_css("span.single-scope-limit-heading", text:, visible: :visible)
else
Expand Down

0 comments on commit fb1036e

Please sign in to comment.