Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/main/cypress/specs/Button.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import employee from "@ui5/webcomponents-icons/dist/employee.js";

import {
BUTTON_ARIA_TYPE_EMPHASIZED,
BUTTON_ROLE_DESCRIPTION,
LINK_ROLE_DESCRIPTION,
} from "../../src/generated/i18n/i18n-defaults.js";

describe("Button general interaction", () => {
Expand Down Expand Up @@ -589,6 +591,7 @@ describe("Accessibility", () => {
expect(info.description).to.include("Submit form");
expect(info.description).to.include(Button.i18nBundle.getText(BUTTON_ARIA_TYPE_EMPHASIZED));
expect(info.role).to.equal("button");
expect(info.type).to.equal(Button.i18nBundle.getText(BUTTON_ROLE_DESCRIPTION));
expect(info.disabled).to.be.false;
});
});
Expand All @@ -602,6 +605,7 @@ describe("Accessibility", () => {
const info = button.accessibilityInfo;

expect(info.role).to.equal("link");
expect(info.type).to.equal(Button.i18nBundle.getText(LINK_ROLE_DESCRIPTION));
expect(info.disabled).to.be.true;
expect(info.description).to.be.undefined;
});
Expand Down
3 changes: 2 additions & 1 deletion packages/main/cypress/specs/TableCustomAnnouncement.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ describe("Cell Custom Announcement - More details", () => {
}

cy.get("body").then($body => {
debugger;
expect($body.find("#ui5-table-invisible-text").text()).to.equal(expectedText);
});
}
Expand Down Expand Up @@ -126,7 +127,7 @@ describe("Cell Custom Announcement - More details", () => {
checkAnnouncement(CONTAINS_CONTROL, true);

cy.realPress("ArrowRight"); // fourth cell focused
checkAnnouncement(`Row1Cell3 . ${CONTAINS_CONTROL}`);
checkAnnouncement(`Button Row1Cell3 . ${CONTAINS_CONTROL}`);
cy.focused().should("have.attr", "aria-colindex", "5")
.should("have.attr", "role", "gridcell");

Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,11 @@ class Button extends UI5Element implements IButton {
}

get effectiveAccRoleTranslation(): string {
if (this.role === ButtonAccessibleRole.Button) {
if (this.accessibleRole as ButtonAccessibleRole === ButtonAccessibleRole.Button) {
return Button.i18nBundle.getText(BUTTON_ROLE_DESCRIPTION);
}

if (this.role === ButtonAccessibleRole.Link) {
if (this.accessibleRole as ButtonAccessibleRole === ButtonAccessibleRole.Link) {
return Button.i18nBundle.getText(LINK_ROLE_DESCRIPTION);
}

Expand Down
Loading