From 2c456f2895432b58ac7d571b2944ac0097355ebb Mon Sep 17 00:00:00 2001
From: Matthew Landauer
Date: Mon, 30 Oct 2023 00:54:37 +0000
Subject: [PATCH] Improve accessibility of preview page
---
app/views/comment_mailer/_footer.html.haml | 2 +-
app/views/comment_mailer/_notify_authority.html.haml | 2 +-
spec/features/comment_to_authority_spec.rb | 7 +++++++
spec/mailers/regression/comment_mailer/email1.html | 4 ++--
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/app/views/comment_mailer/_footer.html.haml b/app/views/comment_mailer/_footer.html.haml
index ddbe423da..d54797cb7 100644
--- a/app/views/comment_mailer/_footer.html.haml
+++ b/app/views/comment_mailer/_footer.html.haml
@@ -4,7 +4,7 @@
for the public good.
= link_to "View this application on PlanningAlerts", application_url(comment.application, protocol: "https")
-%h4 Important Privacy Notice - Please Read
+%h3 Important Privacy Notice - Please Read
%p
The email address and street address are provided to
diff --git a/app/views/comment_mailer/_notify_authority.html.haml b/app/views/comment_mailer/_notify_authority.html.haml
index fef84889e..382e0f7c9 100644
--- a/app/views/comment_mailer/_notify_authority.html.haml
+++ b/app/views/comment_mailer/_notify_authority.html.haml
@@ -20,7 +20,7 @@
%th{ scope: "row", align: "left", valign: "top" } Email of commenter:
%td{ valign: "top" }= comment.email
-%h4 Comment
+%h3 Comment
= comment_as_html(comment.text)
%hr
diff --git a/spec/features/comment_to_authority_spec.rb b/spec/features/comment_to_authority_spec.rb
index 657c8eeb8..be87734cd 100644
--- a/spec/features/comment_to_authority_spec.rb
+++ b/spec/features/comment_to_authority_spec.rb
@@ -98,6 +98,13 @@
expect(page).to have_content("I think this is a really good ideas")
end
+ describe "accessibility tests", js: true do
+ 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")
+ end
+ end
+
it "is not immediately publically visible in the comments section" do
visit(application_path(application))
within("#comments") do
diff --git a/spec/mailers/regression/comment_mailer/email1.html b/spec/mailers/regression/comment_mailer/email1.html
index a276b19be..8c531f298 100644
--- a/spec/mailers/regression/comment_mailer/email1.html
+++ b/spec/mailers/regression/comment_mailer/email1.html
@@ -25,7 +25,7 @@
foo@bar.com |
-Comment
+Comment
It's a good thing.
Oh yes it is.
@@ -36,7 +36,7 @@ Comment
for the public good.
View this application on PlanningAlerts
-Important Privacy Notice - Please Read
+Important Privacy Notice - Please Read
The email address and street address are provided to
Foobar Shire Council