From ed46e7afd2b1e27bcdb36dc6a28ca7511083b48b Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 6 Nov 2023 05:09:39 +0000 Subject: [PATCH] Add accessibility tests for page --- spec/features/applications_spec.rb | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/spec/features/applications_spec.rb b/spec/features/applications_spec.rb index 06593cf73..ee266e0eb 100644 --- a/spec/features/applications_spec.rb +++ b/spec/features/applications_spec.rb @@ -5,18 +5,34 @@ describe "Applications pages" do include Devise::Test::IntegrationHelpers - # rubocop:disable RSpec/NoExpectationExample - it "renders the page", js: true do + before do create(:geocoded_application, address: "24 Bruce Road Glenbrook", description: "A lovely house") create(:geocoded_application, address: "351 Pacific Hwy, Coffs Harbour NSW 2450", description: "S4.55(1A) - Modification - alignment of 20 cabins rotated - positions of duplex cabins swapped with other cabins - 2 bedroom cabins changed to a duplex cabin 1 bedroom & studio") + end + + describe "in the new design" do + before do + sign_in create(:confirmed_user, tailwind_theme: true, name: "Jane Ng") + end + + describe "index page" do + before do + visit applications_path + end + + it "passes accessibility tests", js: true do + expect(page).to be_axe_clean + end - sign_in create(:confirmed_user, tailwind_theme: true, name: "Jane Ng") - visit applications_path - page.percy_snapshot("Most recent applications across Australia") + # rubocop:disable RSpec/NoExpectationExample + it "renders the page", js: true do + page.percy_snapshot("Most recent applications across Australia") + end + # rubocop:enable RSpec/NoExpectationExample + end end - # rubocop:enable RSpec/NoExpectationExample end