Skip to content
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

fix: Minor accessibility warnings #141

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ and this project adheres to [Calendar Versioning](https://calver.org/).
- Support for the new type definitions from React 18 ([#113](https://github.com/vtex-sites/nextjs.store/pull/113)).

### Changed

- The helper log function `logToTerminal` used by `cy.checkA11y` to also report the HTML element associated to the violation to help with identification ([#141](https://github.com/vtex-sites/nextjs.store/pull/141))
- Updates `facets` breakpoints tokens ([#150](https://github.com/vtex-sites/nextjs.store/pull/150))
- Move logo's svg code from JS into static asset ([#135](https://github.com/vtex-sites/nextjs.store/pull/135))
- Upgrade dependencies ([#131](https://github.com/vtex-sites/nextjs.store/pull/131))
Expand All @@ -511,7 +511,6 @@ and this project adheres to [Calendar Versioning](https://calver.org/).

### Fixed

- `ImageGallerySelector` scroll that isn't working on Safari ([##132](https://github.com/vtex-sites/nextjs.store/pull/#132))
- Some console errors when running the storybook ([#129](https://github.com/vtex-sites/nextjs.store/pull/129))
- The search input's dropdown not closing when a suggested product was selected ([#112](https://github.com/vtex-sites/nextjs.store/pull/112).
- Status code when error occurs (404/500) ([#116](https://github.com/vtex-sites/nextjs.store/pull/116))
Expand Down
9 changes: 9 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ function logToTerminal(violations) {
nodes: nodes.length,
}))
)
for (const violation of violations) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of this new log. Hoping it can help us to better pinpoint the elements with the issues.
Screen Shot 2022-06-21 at 15 38 01

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 thank youu!

cy.task(
'table',
violation.nodes.map(({ html }) => ({
id: violation.id,
html,
}))
)
}
}

Cypress.Commands.overwrite(
Expand Down
12 changes: 9 additions & 3 deletions src/components/common/Footer/FooterLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import styles from './footer.module.scss'

const links = [
{
id: 'footer-our-company',
title: 'Our company',
items: [
{
Expand All @@ -29,6 +30,7 @@ const links = [
],
},
{
id: 'footer-orders-and-purchases',
title: 'Orders & Purchases',
items: [
{
Expand All @@ -50,6 +52,7 @@ const links = [
],
},
{
id: 'footer-support-and-services',
title: 'Support & Services',
items: [
{
Expand All @@ -67,6 +70,7 @@ const links = [
],
},
{
id: 'footer-partnership',
title: 'Partnerships',
items: [
{
Expand Down Expand Up @@ -141,10 +145,12 @@ function FooterLinks() {
<div className="hidden-mobile">
<nav data-fs-footer-links-columns>
{links.map((section) => (
<div key={section.title}>
<p data-fs-footer-title>{section.title}</p>
<nav key={section.title} aria-labelledby={section.id}>
<p data-fs-footer-title id={section.id}>
{section.title}
</p>
<LinksList items={section.items} />
</div>
</nav>
))}
</nav>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/common/Navbar/navbar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
width: 0;
padding: 0;
border-width: 0;
opacity: 0;

&:hover, &:focus, &:focus-visible &:hover:focus-visible {
border-width: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/Hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Hero = ({
sizes="(max-width: 768px) 70vw, 50vw"
/>
</UIHeroImage>
<UIHeroHeading data-fs-hero-heading aria-labelledby="hero-heading">
<UIHeroHeading data-fs-hero-heading>
<div data-fs-hero-wrapper className="layout__content">
<div data-fs-hero-info>
<h1 data-fs-hero-title>{title}</h1>
Expand Down