Use labels in controls to add and select languages

The absence of labels in these controls made them hard to use,
particularly for people who use screen readers.

Note we're removing the "Choose language" prompt, since we always
automatically choose a language and not choosing a language doesn't
really make sense. The only scenario where the prompt was used took
place when all languages had been removed but, in that case, the "Choose
language" prompt was misleading because there were no languages to
choose from.
This commit is contained in:
Javi Martín
2024-04-03 23:51:35 +02:00
parent 0f10146273
commit 16fc9998c4
12 changed files with 73 additions and 72 deletions

View File

@@ -149,7 +149,7 @@ describe "Admin legislation questions", :admin do
find("#nested_question_options input").set("Option 1")
select "Español", from: :select_language
select "Español", from: "Current language"
find("#nested_question_options input").set("Opción 1")
@@ -158,7 +158,7 @@ describe "Admin legislation questions", :admin do
expect(page).to have_field(field_en[:id], with: "Option 1")
select "Español", from: :select_language
select "Español", from: "Current language"
expect(page).to have_field(field_es[:id], with: "Opción 1")
end
@@ -166,13 +166,13 @@ describe "Admin legislation questions", :admin do
scenario "Add new question option after changing active locale" do
visit edit_question_url
select "Español", from: :select_language
select "Español", from: "Current language"
click_link "Add option"
find("#nested_question_options input").set("Opción 1")
select "English", from: :select_language
select "English", from: "Current language"
find("#nested_question_options input").set("Option 1")
@@ -182,7 +182,7 @@ describe "Admin legislation questions", :admin do
expect(page).to have_field(field_en[:id], with: "Option 1")
select "Español", from: :select_language
select "Español", from: "Current language"
expect(page).to have_field(field_es[:id], with: "Opción 1")
end