Skip to content

Commit

Permalink
Merge pull request #1963 from GSA/notify-admin-1937b
Browse files Browse the repository at this point in the history
Fix moderate a11y violations reported by axe-core
  • Loading branch information
jonathanbobel authored Sep 25, 2024
2 parents d3855f4 + 647b37a commit 49ec3dc
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
6 changes: 4 additions & 2 deletions app/templates/components/components/back-link/template.njk
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<a href="{%- if params.href %}{{ params.href }}{% else %}#{% endif -%}" class="usa-link usa-back-link display-inline-flex margin-bottom-3 {%- if params.classes %} {{ params.classes }}{% endif -%}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }}</a>
<nav class="usa-breadcrumb" aria-label="Breadcrumb">
<a href="{{ params.href or '#' }}" class="usa-link usa-back-link display-inline-flex {{ params.classes or '' }}"
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}" {% endfor %}>{{ params.html | safe or params.text or 'Back' }}</a>
</nav>
2 changes: 1 addition & 1 deletion app/templates/components/main_nav.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if help %}
{% include 'partials/tour.html' %}
{% else %}
<nav class="nav margin-bottom-4">
<nav id="nav-main-nav" aria-label="Main navigation" class="nav margin-bottom-4">
<a class="usa-button margin-top-1 margin-bottom-5 width-full"
href="{{ url_for('.choose_template', service_id=current_service.id) }}">Send messages</a>
<ul class="usa-sidenav">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/org_nav.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav class="nav margin-bottom-4">
<nav id="nav-org-nav" aria-label="Organization navigation" class="nav margin-bottom-4">
<ul class="usa-sidenav">
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('dashboard') }}" href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}">Usage</a></li>
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_org_users', org_id=current_org.id) }}">Team members</a></li>
Expand Down
2 changes: 2 additions & 0 deletions app/templates/components/service_nav.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<nav id="nav-service-nav" aria-label="Service navigation">
<div class="navigation-service margin-top-5 display-flex flex-align-end flex-justify border-bottom padding-bottom-1">
{% if current_service.organization_id %}
{% if current_user.platform_admin or
Expand All @@ -13,3 +14,4 @@
</div>
<a href="{{ url_for('main.choose_account') }}" class="usa-link">Switch service</a>
</div>
</nav>
2 changes: 1 addition & 1 deletion app/templates/views/templates/_template_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% endif %}
</p>
{% else %}
<nav id="template-list">
<nav id="template-list" aria-label="Template list">
{% set checkboxes_data = [] %}

{% if not current_user.has_permissions('manage_templates') %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/views/templates/choose-reply.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1 class="font-body-2xl margin-bottom-3">Choose a template</h1>

{{ live_search(target_selector='#template-list .template-list-item', show=True, form=search_form) }}

<nav id="template-list">
<nav id="template-list" aria-label="Choose reply">
<ul>
{% for item in templates_and_folders %}
<li class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/views/templates/copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1 class="font-body-2xl margin-y-0">{{ page_title }}</h1>
form=search_form,
autofocus=True
) }}
<nav id="template-list">
<nav id="template-list" aria-label="Copy template list">
<ul>
{% for item in services_templates_and_folders %}

Expand Down
4 changes: 2 additions & 2 deletions tests/app/test_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def test_caseworkers_get_caseworking_navigation(
client_request.login(active_caseworking_user)
page = client_request.get("main.choose_template", service_id=SERVICE_ONE_ID)
assert normalize_spaces(page.select_one("header + .grid-container nav").text) == (
"Send messages Sent messages"
"service one Switch service"
)


Expand All @@ -439,5 +439,5 @@ def test_caseworkers_see_jobs_nav_if_jobs_exist(
client_request.login(active_caseworking_user)
page = client_request.get("main.choose_template", service_id=SERVICE_ONE_ID)
assert normalize_spaces(page.select_one("header + .grid-container nav").text) == (
"Send messages Sent messages"
"service one Switch service"
)
7 changes: 2 additions & 5 deletions tests/end_to_end/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ def check_axe_report(page):

results = axe.run(page)

# TODO we are setting this to critical for now
# to keep tests passing. Once the serious and
# moderate issues are fixed, we will set this
# 'moderate'
# TODO fix remaining 'moderate' failures
# so we can set the level we skip to minor only
for violation in results["violations"]:
assert violation["impact"] in [
"minor",
"moderate",
], f"Accessibility violation: {violation}"

0 comments on commit 49ec3dc

Please sign in to comment.