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(ui5-card): correct aria-labelledBy to card and header #2577

Merged
merged 5 commits into from
Dec 15, 2020

Conversation

GerganaKremenska
Copy link
Member

@GerganaKremenska GerganaKremenska commented Dec 14, 2020

Now the aria-labelledBy of card and header contain only the rendered elements.

Fixes: #2426

@CLAassistant
Copy link

CLAassistant commented Dec 14, 2020

CLA assistant check
All committers have signed the CLA.

packages/main/test/specs/Card.spec.js Outdated Show resolved Hide resolved
Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

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

I am fine with the change, I have just one comment about the test, that you can find inline.

const header = browser.$("#card2").shadow$(".ui5-card-header");
const card2 = browser.$("#card3").shadow$(".ui5-card-root");
const header2 = browser.$("#card3").shadow$(".ui5-card-header");
const EXPECTED_ARIA_LABELLEDBY_CARD = "ui5wc_20-heading ui5wc_20-desc";
Copy link
Member

@ilhan007 ilhan007 Dec 14, 2020

Choose a reason for hiding this comment

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

To make the test more robust you can use the built-in "_id" property - card1.getProperty("_id"), card2.getProperty("_id") to get these parts ui5wc_20 and ui5wc_21.
Because, if someone adds more cards in the test page, these cards might get different IDs, f.e. ui5wc_23, ui5wc_24 as these numbers depend on the component's definition order and every time the test might need to be adjusted as it would fail.

const card1Id = card1.getProperty("_id");
const EXPECTED_ARIA_LABELLEDBY_CARD = `${card1Id}-heading ${card1Id}-desc`;
const EXPECTED_ARIA_LABELLEDBY_HEADER = "${card1Id}-subheading ${card1Id}-status ${card1Id}-avatar";

const card2Id = card2.getProperty("_id");
...

Also, for reference how "_id" is used you can see NotificationList.spec.js -> "tests List Group Item ACC ariaLabelledBy".

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for the feedback. :) applied to the change.

@ilhan007 ilhan007 merged commit 2647941 into SAP:master Dec 15, 2020
niyap pushed a commit to niyap/ui5-webcomponents that referenced this pull request Dec 17, 2020
Now the aria-labelledBy of card and header contain only the rendered elements.

Fixes: SAP#2426
@elenastoyanovaa
Copy link
Contributor

@GerganaKremenska could you please update the Accessibility Status of the Card component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A11y - CPM Activity Integration with Goals - ARIA attributes - Invalid use of aria attribute
7 participants