Add alt attribute to map images

We were using it on the map displayed on the sidebar, but we weren't
using it in the other places were the map is rendered.
This commit is contained in:
Javi Martín
2024-10-12 21:43:17 +02:00
parent 96e4ed4c36
commit 597a21eca9
3 changed files with 5 additions and 5 deletions

View File

@@ -23,6 +23,6 @@
</div> </div>
<div class="medium-5 column show-for-medium text-center"> <div class="medium-5 column show-for-medium text-center">
<%= image_tag(image_path_for("map.jpg")) %> <%= image_tag(image_path_for("map.jpg"), alt: t("shared.tags_cloud.districts_list")) %>
</div> </div>
</div> </div>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="show-for-medium medium-9 column text-center"> <div class="show-for-medium medium-9 column text-center">
<%= image_tag(image_path_for("map.jpg"), usemap: "#map") %> <%= image_tag(image_path_for("map.jpg"), alt: t("shared.tags_cloud.districts_list"), usemap: "#map") %>
</div> </div>
<map name="map" id="html_map"> <map name="map" id="html_map">

View File

@@ -45,19 +45,19 @@ describe "Admin custom images", :admin do
visit proposals_path visit proposals_path
within("#map") do within("#map") do
expect(page).to have_css("img[src*='custom_map.jpg']") expect(page).to have_css("img[src*='custom_map.jpg'][alt='Districts list']")
end end
visit map_proposals_path visit map_proposals_path
within(".show-for-medium") do within(".show-for-medium") do
expect(page).to have_css("img[src*='custom_map.jpg']") expect(page).to have_css("img[src*='custom_map.jpg'][alt='Districts list']")
end end
visit budget_group_path(budget, group) visit budget_group_path(budget, group)
within(".show-for-medium") do within(".show-for-medium") do
expect(page).to have_css("img[src*='custom_map.jpg']") expect(page).to have_css("img[src*='custom_map.jpg'][alt='Districts list']")
end end
end end