-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[114] Add CI for A11y (axe-core-rspec) #141
Changes from all commits
a013578
80b5e76
93580ac
19881f9
626bb82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ require: | |
- rubocop-rails | ||
- rubocop-rake | ||
- rubocop-rspec | ||
- rubocop-capybara | ||
|
||
AllCops: | ||
NewCops: enable | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
// Entry point for your Sass build | ||
// Entry point for your Sass build | ||
|
||
/* Backdrop is only displayed when dialog is opened with dialog.showModal() */ | ||
dialog::backdrop { | ||
background: rgba(0, 0, 0, 0.5); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<div class="usa-card__container custom-card col-md-6 rules-of-behavior"> | ||
<div class="usa-card__body"> | ||
<% if logged_in? %> | ||
Logged In Dashboard Index | ||
<% else %> | ||
Logged Out Dashboard Index | ||
<% end %> | ||
<main role="main"> | ||
<div class="usa-card__container custom-card col-md-6 rules-of-behavior"> | ||
<h1 class="usa-card__body"> | ||
<% if logged_in? %> | ||
Logged In Dashboard Index | ||
<% else %> | ||
Logged Out Dashboard Index | ||
<% end %> | ||
</h1> | ||
</div> | ||
</div> | ||
</main> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<html lang="en"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a11y fix |
||
<head> | ||
<title>RailsNew</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
|
@@ -9,8 +9,6 @@ | |
<%= stylesheet_link_tag "styles" %> | ||
<%= stylesheet_link_tag "application" %> | ||
<%= javascript_include_tag 'application' %> | ||
<%= javascript_include_tag 'uswds', async: true %> | ||
<%= javascript_include_tag 'uswds-init', async: true %> | ||
|
||
<% if logged_in? %> | ||
<script> | ||
|
@@ -34,5 +32,7 @@ | |
|
||
<%= render "layouts/footer" %> | ||
<%= render "modals/renew_session" %> | ||
<%= javascript_include_tag 'uswds', async: true %> | ||
<%= javascript_include_tag 'uswds-init', async: true %> | ||
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix the load order bug that caused race condition on js eval |
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
<a href="#renew-modal" style="display:none;" id="renew-modal-open-button" class="usa-button" aria-controls="renew-modal" data-open-modal></a> | ||
|
||
<div | ||
class="usa-modal" | ||
id="renew-modal" | ||
aria-labelledby="modal-1-heading" | ||
aria-describedby="modal-1-description" | ||
> | ||
<dialog | ||
id="renew-modal" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. switching to standard |
||
class="border-width-0 radius-lg" | ||
aria-labelledby="renew-modal-heading" | ||
aria-describedby="renew-modal-description"> | ||
<div class="usa-modal__content"> | ||
<div class="usa-modal__main"> | ||
<h2 class="usa-modal__heading" id="modal-1-heading"> | ||
<h2 class="usa-modal__heading" id="renew-modal-heading"> | ||
Session expire | ||
</h2> | ||
<div class="usa-prose"> | ||
<p id="modal-1-description"> | ||
<p id="renew-modal-description"> | ||
Your session will expire in <span class="countdown"></span><br> | ||
Please click below if you would like to continue. | ||
</p> | ||
|
@@ -21,6 +18,5 @@ | |
<button class="usa-button modal-btn" id="extend-session-button" data-close-modal type="button">Renew Session</button> | ||
</div> | ||
</div> | ||
<a href="#renew-modal" style="display:none;" id="renew-modal-close-button" class="usa-button" data-close-modal></a> | ||
</div> | ||
</div> | ||
</dialog> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
RSpec.configure do |config| | ||
config.before(:each, type: :system) do | ||
driven_by :rack_test | ||
WebMock.allow_net_connect! | ||
end | ||
|
||
config.before(:each, :js, type: :system) do | ||
driven_by :selenium_chrome_headless | ||
|
||
# Uncomment the next line to run system tests locally in a visible (non-headless) browser | ||
# driven_by :selenium, using: :chrome, screen_size: [1400, 1400] | ||
end | ||
|
||
config.after(:each, type: :system) do | ||
WebMock.disable_net_connect!(allow_localhost: true) | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe "A11y", :js do | ||
it "web root page is accessible" do | ||
visit "/" | ||
|
||
expect(page).to(be_axe_clean) | ||
end | ||
|
||
it "dashboard index page is accessible" do | ||
visit dashboard_path | ||
|
||
expect(page).to(be_axe_clean) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new lines fix some existing a11y issues