-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Add addon-a11y to monorepo #2292
Conversation
* Add Button example * Add semicolon behind import * Add Image example * Add Form examples * Add Typography examples
This allows us to test against the original html structure with storyshot’s snapshot testing.
Changed some "you're" in "your"
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.
Fix up those references to the old package name and move the package Storybook over to our CRA.
I think it's good to take a pass and see if this work with React 16 too. I don't see anything obvious that would break, but more testing is always good.
const text = Faker.lorem.words(); | ||
|
||
storiesOf('<Button />', module) | ||
.addDecorator(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.
I think these a11y stories should be moved over to CRA so we can test them together.
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.
agree
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.
Added, will leave the old storybook, because might copy over some more stories later.
addons/a11y/README.md
Outdated
First, install the addon. | ||
|
||
```sh | ||
$ npm install -D storybook-addon-a11y |
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.
new package name?
addons/a11y/README.md
Outdated
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
|
||
import { checkA11y } from 'storybook-addon-a11y'; |
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.
same here
addons/a11y/package.json
Outdated
"dependencies": { | ||
"@storybook/react": "^3.2.14", | ||
"axe-core": "^2.0.7", | ||
"prop-types": "^15.5.10" |
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.
peer dep? also this shouldn't require @storybook/react
da47b56
to
607f37d
Compare
addons/a11y/.gitignore
Outdated
@@ -0,0 +1,3 @@ | |||
node_modules | |||
coverage | |||
dist |
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.
Looks like it's all covered by root .gitignore
Codecov Report
@@ Coverage Diff @@
## master #2292 +/- ##
==========================================
- Coverage 22.14% 21.19% -0.95%
==========================================
Files 268 283 +15
Lines 5893 6156 +263
Branches 710 724 +14
==========================================
Hits 1305 1305
- Misses 4060 4302 +242
- Partials 528 549 +21
Continue to review full report at Codecov.
|
Seems to work fine with React 16.1.x! |
addons/a11y/register.js
Outdated
@@ -0,0 +1,3 @@ | |||
// NOTE: loading addons using this file is deprecated! |
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.
Why?
Code looks good to go, you'll need to rebase and the tests though. |
9cf2947
to
3bf698c
Compare
Should be OK to merge now, @Hypnosphi doe you agree? |
|
||
storiesOf('Addon a11y', module) | ||
.addDecorator(checkA11y) | ||
.add('Default', () => <BaseButton />) |
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 produces a propType warning:
Warning: Failed prop type: The prop `label` is marked as required in `BaseButton`, but its value is `undefined`
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.
Will fix!
Closes: storybook-eol/storybook-addon-a11y#14
What I did
Merged in the a11y addon into the monorepo
How to test
It's used in the cra-kitchen-sink