diff --git a/packages/main/cypress/specs/Button.cy.tsx b/packages/main/cypress/specs/Button.cy.tsx index b0dc10aa84eb5..3e4be6b648654 100644 --- a/packages/main/cypress/specs/Button.cy.tsx +++ b/packages/main/cypress/specs/Button.cy.tsx @@ -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", () => { @@ -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; }); }); @@ -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; }); diff --git a/packages/main/cypress/specs/TableCustomAnnouncement.cy.tsx b/packages/main/cypress/specs/TableCustomAnnouncement.cy.tsx index d9c9658ad7a24..50938df5b3518 100644 --- a/packages/main/cypress/specs/TableCustomAnnouncement.cy.tsx +++ b/packages/main/cypress/specs/TableCustomAnnouncement.cy.tsx @@ -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); }); } @@ -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"); diff --git a/packages/main/src/Button.ts b/packages/main/src/Button.ts index 4a771405a940a..9dc49b0bbb108 100644 --- a/packages/main/src/Button.ts +++ b/packages/main/src/Button.ts @@ -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); }