-
Notifications
You must be signed in to change notification settings - Fork 151
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
Orbit Storybook - a11y issues #4497
base: master
Are you sure you want to change the base?
Conversation
Storybook staging is available at https://kiwicom-orbit-sarka-sb-a11y-fixes.surge.sh |
Size Change: 0 B Total Size: 459 kB ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
603a5f8
to
ffa2f1b
Compare
ffa2f1b
to
1e4e5d0
Compare
0209f84
to
7b9dd78
Compare
// Invokes Storybook's addon API method event to trigger a UI refresh. | ||
// Ensures that a11y addons is refreshed and shows the correct list of component accessibility issues. | ||
console.log("Component is being rerendered."); | ||
addons.getChannel().emit("forceReRender"); |
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.
An explanation of the function is described here.
import { injectAxe, checkA11y } from "axe-playwright"; | ||
|
||
/* | ||
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api |
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.
Using the test-runner
and depended packages, we are able to run a11y SB checks and generate an HTML report.
9a05101
to
613e57c
Compare
@@ -0,0 +1,27 @@ | |||
# About |
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.
I created this file to document somewhere information on how to run test-runner and that's important to run this script once the storybook local server is running as well.
This could be as a point of discussion if we want to have this file, ofc.
613e57c
to
27acf99
Compare
68c1a0a
to
8723ace
Compare
@@ -12,7 +12,7 @@ jobs: | |||
update-visual-tests: | |||
runs-on: ubuntu-latest | |||
container: | |||
image: mcr.microsoft.com/playwright:v1.44.1-jammy | |||
image: mcr.microsoft.com/playwright:v1.48.2-jammy |
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.
I've changed the PW version based on this error log.
https://github.com/kiwicom/orbit/actions/runs/11632651461/job/32396199861?pr=4497
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.
Also, I had to update visual tests as they were failing.
1ba425a
to
8723ace
Compare
a187afc
to
5a8b07c
Compare
This implementation ensures that every story is re-rendered. Without that the Storybook doesn't show the correct number and list of accessibility issues.
5a8b07c
to
f00e5c0
Compare
}, | ||
async postVisit(page, story) { | ||
const fileName = story.name.replace(/\s+/g, ""); | ||
await checkA11y( |
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.
We agreed we don't need the HTML reports for Orbit components, right?
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.
Is this issue still relevant? Do we have problems with the Orbit storybook?
I remember Nitro's Storybook being problematic but Orbit one was working correctly, wasn't it?
This Pull Request meets the following criteria:
For new components:
d.ts
files and are exported inindex.d.ts
List of SB errors:
Closes: https://kiwicom.atlassian.net/browse/FEPLT-2146