Skip to content

Commit 505ed05

Browse files
author
Meyric Rawlings
authored
Merge pull request #353 from DFE-Digital/accessibility-tests-for-remaining-groups
Accessibility tests for remaining groups
2 parents 0d78885 + 3bd8cdb commit 505ed05

File tree

13 files changed

+228
-8
lines changed

13 files changed

+228
-8
lines changed

.github/workflows/continuous-integration-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636

3737
- name: Run checks
3838
run: script/ci/accessibility
39-
continue-on-error: true
4039

4140
- if: always() && steps.cache-docker.outputs.cache-hit != 'true'
4241
name: Prepare Docker cache

app/views/conversion/involuntary/projects/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% content_for :pre_content_nav do %>
2-
<%= govuk_back_link(href: root_path) %>
2+
<% render partial: "shared/back_link", locals: {href: root_path} %>
33
<% end %>
44

55
<div class="govuk-grid-row">

app/views/conversion/voluntary/projects/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% content_for :pre_content_nav do %>
2-
<%= govuk_back_link(href: root_path) %>
2+
<% render partial: "shared/back_link", locals: {href: root_path} %>
33
<% end %>
44

55
<div class="govuk-grid-row">

app/views/project_information/show/_side_navigation.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<nav>
2-
<h3 class="govuk-heading-m"><%= t("project_information.show.side_navigation.title") %></h3>
2+
<h2 class="govuk-heading-m"><%= t("project_information.show.side_navigation.title") %></h2>
33
<ul class="list-style-none govuk-!-padding-0">
44
<%= render partial: "shared/side_navigation_item", locals: {name: t("project_information.show.project_details.title"), path: "#projectDetails"} %>
55
<%= render partial: "shared/side_navigation_item", locals: {name: t("project_information.show.school_details.title"), path: "#schoolDetails"} %>

script/all/test-accessibility

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
set -e
44

55
echo "==> Running accessibility checks..."
6-
bundle exec rspec --tag accessibility
6+
NO_COVERAGE=true bundle exec rspec --tag accessibility
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
require "rails_helper"
2+
require "axe-rspec"
3+
4+
RSpec.feature "Test assignment accessibility", driver: :headless_firefox, accessibility: true do
5+
let(:user) { create(:user, :team_leader) }
6+
let(:project) { create(:project) }
7+
8+
before do
9+
mock_successful_api_responses(urn: 123456, ukprn: 10061021)
10+
sign_in_with_user(user)
11+
end
12+
13+
scenario "test change team lead for project page" do
14+
visit project_assign_team_lead_path(project)
15+
16+
expect(page).to have_content("Change team lead")
17+
expect(page).to be_axe_clean
18+
end
19+
20+
scenario "test change caseworker for project page" do
21+
visit project_assign_caseworker_path(project)
22+
23+
expect(page).to have_content("Change caseworker")
24+
expect(page).to be_axe_clean
25+
end
26+
27+
scenario "test change regional delivery officer for project page" do
28+
visit project_assign_regional_delivery_officer_path(project)
29+
30+
expect(page).to have_content("Change regional delivery officer")
31+
expect(page).to be_axe_clean
32+
end
33+
end
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
require "rails_helper"
2+
require "axe-rspec"
3+
4+
RSpec.feature "Test authentication accessibility", driver: :headless_firefox, accessibility: true do
5+
scenario "sign in page" do
6+
visit sign_in_path
7+
8+
expect(page).to have_content("Sign in")
9+
expect(page).to be_axe_clean
10+
end
11+
12+
scenario "sign out page" do
13+
visit sign_out_path
14+
15+
expect(page).to have_content("You have signed out")
16+
expect(page).to be_axe_clean
17+
end
18+
19+
scenario "authentication failed page" do
20+
visit auth_failure_path
21+
22+
expect(page).to have_content("Authentication failed.")
23+
expect(page).to be_axe_clean
24+
end
25+
end

spec/accessibility/contacts_spec.rb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
require "rails_helper"
2+
require "axe-rspec"
3+
4+
RSpec.feature "Test contacts accessibility", driver: :headless_firefox, accessibility: true do
5+
let(:user) { create(:user, email: "[email protected]") }
6+
let(:project) { create(:project, caseworker: user) }
7+
8+
before do
9+
mock_successful_api_responses(urn: 123456, ukprn: 10061021)
10+
sign_in_with_user(user)
11+
end
12+
13+
scenario "show contacts page" do
14+
contact = create(:contact, project: project)
15+
visit project_contacts_path(project)
16+
17+
expect(page).to have_content(contact.name)
18+
expect(page).to be_axe_clean
19+
end
20+
21+
scenario "new page" do
22+
visit new_project_contact_path(project)
23+
24+
expect(page).to have_content("Add contact")
25+
expect(page).to be_axe_clean
26+
end
27+
28+
scenario "edit page" do
29+
contact = create(:contact, project: project)
30+
visit edit_project_contact_path(project, contact)
31+
32+
expect(page).to have_content("Edit contact")
33+
expect(page).to be_axe_clean
34+
end
35+
36+
scenario "deleted page" do
37+
contact = create(:contact, project: project)
38+
visit project_contact_delete_path(project, contact)
39+
40+
expect(page).to have_content(contact.name)
41+
expect(page).to be_axe_clean
42+
end
43+
end

spec/accessibility/notes_spec.rb

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
require "rails_helper"
2+
require "axe-rspec"
3+
4+
RSpec.feature "Test note accessibility", driver: :headless_firefox, accessibility: true do
5+
let(:user) { create(:user, email: "[email protected]") }
6+
let(:project) { create(:project, caseworker: user) }
7+
let(:section) { create(:section, project: project) }
8+
let(:task) { create(:task, section: section) }
9+
10+
before do
11+
mock_successful_api_responses(urn: 123456, ukprn: 10061021)
12+
sign_in_with_user(user)
13+
end
14+
15+
describe "Project level notes" do
16+
let!(:note) { create(:note, user: user, project: project) }
17+
scenario "show notes page" do
18+
visit project_notes_path(project)
19+
20+
expect(page).to have_content(note.body)
21+
expect(page).to be_axe_clean
22+
end
23+
24+
scenario "new page" do
25+
visit new_project_note_path(project)
26+
27+
expect(page).to have_content("Enter note")
28+
expect(page).to be_axe_clean
29+
end
30+
31+
scenario "edit page" do
32+
visit edit_project_note_path(project, note)
33+
34+
expect(page).to have_content(note.body)
35+
expect(page).to be_axe_clean
36+
end
37+
38+
scenario "deleted page" do
39+
visit project_note_delete_path(project, note)
40+
41+
expect(page).to have_content("Are you sure you want to delete this note?")
42+
expect(page).to be_axe_clean
43+
end
44+
end
45+
46+
describe "Task notes" do
47+
let!(:task_note) { create(:note, project: project, task: task) }
48+
scenario "new page" do
49+
visit new_project_note_path(project, task)
50+
51+
expect(page).to have_content("Enter note")
52+
expect(page).to be_axe_clean
53+
end
54+
55+
scenario "show page" do
56+
visit project_task_path(project, task)
57+
58+
expect(page).to have_content(task_note.body)
59+
expect(page).to be_axe_clean
60+
end
61+
end
62+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require "rails_helper"
2+
require "axe-rspec"
3+
4+
RSpec.feature "Test project information accessibility", driver: :headless_firefox, accessibility: true do
5+
let(:user) { create(:user, email: "[email protected]") }
6+
let(:project) { create(:project, caseworker: user) }
7+
8+
before do
9+
mock_successful_api_responses(urn: 123456, ukprn: 10061021)
10+
sign_in_with_user(user)
11+
end
12+
13+
scenario "project information page" do
14+
visit project_information_path(project)
15+
16+
expect(page).to have_content("Project details")
17+
expect(page).to be_axe_clean
18+
end
19+
end

0 commit comments

Comments
 (0)