-
Notifications
You must be signed in to change notification settings - Fork 181
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
test(cv-link): add tests for a11y #1539
test(cv-link): add tests for a11y #1539
Conversation
I updated the guidance a bit to add a link to the React storybook. There might be DOM difference for accessibility there that might be helpful in resolving any test issues.
|
I think the test cases can be resolved by adding
|
Thanks @davidnixon, I wasn't sure if I should update actual component, and I had a lot of work lately, but thanks for your advice 👍🏽 |
v-if="icon" | ||
:class="`${carbonPrefix}--link__icon`" | ||
:svg="icon" | ||
alt="" |
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.
Empty alt because it's "an advisory icon of minimal importance"
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.
lgtm
Contributes to #1538
What did you do?
Add a11y test for
CvLink
Why did you do it?
Adding 3 test cases, for simple link, one in disabled state and the other one with an icon
How have you tested it?
Using testing library, the icon one is failing because needs a label, but I'm not sure how to proceed
Notes
I have an idea of naming convention for accessibility tests, maybe we can use the abbreviation,
[Component].a11y.spec.js
?Thank you in advance