-
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
Integrate axe-playwright into storybook/test-runner #828
base: main
Are you sure you want to change the base?
Conversation
417e5d8
to
646829d
Compare
646829d
to
6ce0603
Compare
@@ -111,8 +111,21 @@ DefaultOutline.parameters = { | |||
], | |||
}; | |||
|
|||
const baseTabArgs = { | |||
colorVariant: ['tab'], | |||
role: 'tab', |
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.
aria-selected
is not allowed on normal buttons, so a tab role must be added. And then the button needs to we wrapped in a tablist because tabs must be children of tablists only, they cannot stand alone.
@@ -91,7 +91,7 @@ breadCrumbsMenu.innerHTML = ` | |||
</svg> | |||
</li>`; | |||
|
|||
export const header = document.createElement('header'); | |||
export const header = document.createElement('div'); |
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.
This component is already wrapped in a header landmark, so it cannot have another header landmark inside of it.
@@ -86,7 +86,6 @@ const menu = ` | |||
}).outerHTML | |||
} | |||
</li> | |||
<li role="separator"></li> |
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.
See #829
@@ -47,9 +44,12 @@ const labels = [ | |||
'Sales', | |||
]; | |||
|
|||
labels.forEach((label) => | |||
buttonList.appendChild(listItem.appendChild(buttomComponent(label))) |
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.
This cause appendChild
returns the child, not the parent, so this code was resulting in buttons being appended directly to the list, and the list item was unused.
// TODO: enable this rule again once all color contrast issues are fixed | ||
'color-contrast': { | ||
enabled: false, | ||
}, |
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.
To be enbled when working on #814
<dl class="u-grid u-grid-cols-3@m u-gap-m"> | ||
<div class="u-grid u-grid-cols-3@m u-gap-m"> |
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.
It is not possible to write a valid definition list that has this layout. There can't be a double-nested div in dl
, so it's not possible to put a badge in there. It is very limited which children are valid in a dl
.
This is valid:
<dl>
<dt></dt>
<dd></dd>
</dl>
<dl>
<div>
<dt></dt>
<dd></dd>
</div>
</dl>
This is not valid
<dl>
<div>
<div>
<dt></dt>
<dd></dd>
</div>
</div>
</dl>
<dl>
<div>
<div>
</div>
</div>
<dt></dt>
<dd></dd>
</dl>
</li> | ||
</ul> | ||
<div class="u-list-none u-flex u-flex-wrap u-items-end a-button--tab-container u-margin-m-bottom" role="tablist" aria-label="Patient data"> | ||
<button class="a-button a-button--tab u-margin-s2-right" role="tab" aria-selected="true" aria-controls="tab-panel-1" id="tab-1" tabindex="0"> |
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.
Buttons with role tab should be direct children of a tablist
@@ -13,20 +13,23 @@ By default `hidden`, `auto`, and `scroll` values are available, at all direction | |||
{` | |||
<div class="u-overflow-hidden u-bg-brand-2" style="height: 5rem"> | |||
u-overflow-x-auto Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer. Gummies cheesecake oat cake sugar plum icing cupcake tiramisu bonbon. Cotton candy chupa chups tootsie roll chupa chups cotton candy liquorice jelly gingerbread. Pastry gummi bears liquorice tart cotton candy marshmallow. Ice cream cotton candy chocolate cake cookie. Bonbon candy jelly-o sugar plum cotton candy carrot cake icing ice cream. Sweet chocolate marzipan. Candy canes danish cake carrot cake bonbon. Gummi bears sesame snaps tart bear claw pie chocolate bar. Ice cream candy canes sugar plum cookie. Macaroon biscuit biscuit carrot cake liquorice. Muffin pudding gingerbread powder jelly-o chocolate bar powder jelly beans toffee. | |||
<a href="https://duckduckgo.com">DDG</a> |
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.
There must be a focusable element in an overflowing container
Resolves #414
This PR adds a
test-storybook
command that runs axe-core on all of our stories, includingmdx
stories. It runs this command on CI.I fixed every single accessibility violation except for color contrasts because that requires design skills. I have disabled color contrasts checks for now so we can merge this PR.
All code changes in this PR apply to storybook only. No changes are made to the CSS produced by the library.