Skip to content

Commit db6a8ee

Browse files
committed
Fix row order for Welsh form CSV
The correct order for a question's details in a CSV is - Page heading - Guidance text - Question text - Hint text (if relevant) - List of options (if relevant) This matches how the translations are displayed on the Welsh Translations page The test for this has switched from using `match_array` to `eq` so that the ordering is taken into account.
1 parent 5a1802b commit db6a8ee

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/services/welsh_csv_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ def add_form_name(csv)
3838

3939
def add_page_content(csv)
4040
form.pages.each do |page|
41+
add_page_heading(csv, page)
42+
add_guidance_text(csv, page)
4143
add_question_content(csv, page)
4244
add_selection_options(csv, page) if page.answer_type == "selection"
4345
add_none_of_above_question(csv, page) if has_none_of_the_above?(page)
4446
add_routing_conditions(csv, page)
45-
add_page_heading(csv, page)
46-
add_guidance_text(csv, page)
4747
end
4848
end
4949

spec/services/welsh_csv_service_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@
269269
["Question 1 - question or label if ‘None of the above’ is selected", "None of the above question?", "Welsh None of the above question?"],
270270
["Question 1 - exit page heading", "Exit page heading", "Welsh exit page heading"],
271271
["Question 1 - exit page content", "Exit page markdown", "Welsh exit page markdown"],
272-
["Question 2 - question text", "What?", "Welsh What?"],
273272
["Question 2 - page heading", "Page heading", "Welsh Page heading"],
274273
["Question 2 - guidance text", "This is the guidance.", "Welsh This is the guidance."],
274+
["Question 2 - question text", "What?", "Welsh What?"],
275275
["Declaration", "Declaration text", ""],
276276
["Information about what happens next", "English what happens next", "Welsh what happens next"],
277277
["GOV⁠.⁠UK Pay payment link", "https://www.gov.uk/payment", "https://www.gov.uk/payment_cy"],
@@ -280,7 +280,7 @@
280280
["Contact details for support - phone number and opening times", "English support phone", "Welsh support phone"],
281281
["Contact details for support - online contact link", "https://www.gov.uk/support", "https://www.gov.uk/support_cy"],
282282
["Contact details for support - online contact link text", "Support URL text", "Welsh Support URL text"]]
283-
expect(csv).to match_array(expected_csv)
283+
expect(csv).to eq(expected_csv)
284284
end
285285
end
286286
end

0 commit comments

Comments
 (0)