Skip to content

Commit

Permalink
Improve accessibility of application detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Oct 30, 2023
1 parent 8410a32 commit b04dd93
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/_tailwind/applications/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<dl class="text-2xl text-navy grid md:grid-cols-[18rem_1fr] border-light-grey2 border-y py-4 mt-14">
<dt class="font-bold md:py-1">
<div class="flex gap-4">
<%= image_tag "tailwind/calendar.svg", width: 23 %>
<%= image_tag "tailwind/calendar.svg", width: 23, alt: "" %>
<div>Date sourced</div>
</div>
</dt>
Expand All @@ -64,7 +64,7 @@
<%# TODO: Do we show the notified line if nobody has been notified? %>
<dt class="font-bold md:py-1">
<div class="flex gap-4">
<%= image_tag "tailwind/letter.svg", width: 23 %>
<%= image_tag "tailwind/letter.svg", width: 23, alt: "" %>
<div>Notified</div>
</div>
</dt>
Expand All @@ -76,7 +76,7 @@
<%# TODO: What to do if there are 0 comments? %>
<dt class="font-bold md:py-1">
<div class="flex gap-4">
<%= image_tag "tailwind/comments.svg", width: 23 %>
<%= image_tag "tailwind/comments.svg", width: 23, alt: "" %>
<div>Comments</div>
</div>
</dt>
Expand Down
22 changes: 22 additions & 0 deletions spec/features/comment_to_authority_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@
create(:geocoded_application, id: "1", authority:)
end

describe "accessibility tests in new design", js: true do
before do
sign_in create(:confirmed_user, tailwind_theme: true)
visit(application_path(application))
end

it "main content passes" do
# Limiting check to main content to ignore (for the time being) colour contrast issues with the header and footer
expect(page).to be_axe_clean.within("main").excluding("[data-lat]")
end

it "google maps content passes" do
pending "We have to figure out how to get the aria-labels inside the map and streetview to be different"
expect(page).to be_axe_clean.within("[data-lat]")
end

it "page passes most" do
# Also doing check across whole page so we catch issues like h1 not being used
expect(page).to be_axe_clean.skipping("color-contrast").excluding("[data-lat]")
end
end

it "Adding a comment" do
sign_in create(:confirmed_user)
visit(application_path(application))
Expand Down

0 comments on commit b04dd93

Please sign in to comment.