Skip to content

Commit

Permalink
♿️ certif: add aria-label for footer navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiaPena committed Dec 17, 2024
1 parent 2b4ed7a commit 1bc8716
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion certif/app/components/layout/footer.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class Footer extends Component {

<template>
<footer class='footer'>
<nav class='footer__navigation'>
<nav class='footer__navigation' aria-label={{t 'navigation.footer.aria-label'}}>
<ul class='footer__navigation-list'>
<li>
<a href={{this.legalNoticeUrl}} target='_blank' class='footer-navigation__item' rel='noopener noreferrer'>
Expand Down
8 changes: 5 additions & 3 deletions certif/tests/integration/components/layout/footer_test.gjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render } from '@1024pix/ember-testing-library';
import { render, within } from '@1024pix/ember-testing-library';
import { t } from 'ember-intl/test-support';
import Footer from 'pix-certif/components/layout/footer';
import { module, test } from 'qunit';
Expand Down Expand Up @@ -30,8 +30,9 @@ module('Integration | Component | Layout | Footer', function (hooks) {
const screen = await render(<template><Footer /></template>);

// then
const footerNavigation = screen.getByRole('navigation', {name: t('navigation.footer.aria-label')});
assert
.dom(screen.getByRole('link', { name: t('navigation.footer.legal-notice') }))
.dom(within(footerNavigation).getByRole('link', { name: t('navigation.footer.legal-notice') }))
.hasAttribute('href', 'https://pix.fr/mentions-legales');
});

Expand All @@ -44,8 +45,9 @@ module('Integration | Component | Layout | Footer', function (hooks) {
const screen = await render(<template><Footer /></template>);

// then
const footerNavigation = screen.getByRole('navigation', {name: t('navigation.footer.aria-label')});
assert
.dom(screen.getByRole('link', { name: t('navigation.footer.a11y') }))
.dom(within(footerNavigation).getByRole('link', { name: t('navigation.footer.a11y') }))
.hasAttribute('href', 'https://pix.fr/accessibilite-pix-certif');
});
});
1 change: 1 addition & 0 deletions certif/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"external-link-title": "Open in a new window",
"footer": {
"a11y": "Accessibility",
"aria-label": "Footer navigation",
"current-year": "© {currentYear} Pix",
"legal-notice": "Legal notice"
},
Expand Down
1 change: 1 addition & 0 deletions certif/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"external-link-title": "Ouverture dans une nouvelle fenêtre",
"footer": {
"a11y": "Accessibilité : partiellement conforme",
"aria-label": "Navigation de pied de page",
"current-year": "© {currentYear} Pix",
"legal-notice": "Mentions légales"
},
Expand Down

0 comments on commit 1bc8716

Please sign in to comment.