-
Notifications
You must be signed in to change notification settings - Fork 270
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
Conversation
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 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"; |
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 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".
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.
thanks for the feedback. :) applied to the change.
Now the aria-labelledBy of card and header contain only the rendered elements. Fixes: SAP#2426
@GerganaKremenska could you please update the Accessibility Status of the Card component? |
Now the aria-labelledBy of card and header contain only the rendered elements.
Fixes: #2426