Fix aria-required-children axe violation (#10900)

* Fix aria-required-children axe violation

* Fix test selector
This commit is contained in:
Michael Telatynski 2023-05-15 13:36:28 +01:00 committed by GitHub
parent 4d59a6ff1f
commit 8b7eb8bb1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -47,9 +47,11 @@ describe("Invite dialog", function () {
// Open the room info panel
cy.findByRole("button", { name: "Room info" }).click();
// Click "People" button on the panel
// Regex pattern due to the string of "mx_BaseCard_Button_sublabel"
cy.findByRole("button", { name: /People/ }).click();
cy.get(".mx_RightPanel").within(() => {
// Click "People" button on the panel
// Regex pattern due to the string of "mx_BaseCard_Button_sublabel"
cy.findByRole("button", { name: /People/ }).click();
});
cy.get(".mx_BaseCard_header").within(() => {
// Click "Invite to this room" button

View File

@ -700,6 +700,10 @@ export default class RoomSublist extends React.Component<IProps, IState> {
onKeyDown={this.onHeaderKeyDown}
onFocus={onFocus}
aria-label={this.props.label}
role="treeitem"
aria-expanded={this.state.isExpanded}
aria-level={1}
aria-selected="false"
>
<div className="mx_RoomSublist_stickableContainer">
<div className="mx_RoomSublist_stickable">
@ -708,9 +712,7 @@ export default class RoomSublist extends React.Component<IProps, IState> {
inputRef={ref}
tabIndex={tabIndex}
className="mx_RoomSublist_headerText"
role="treeitem"
aria-expanded={this.state.isExpanded}
aria-level={1}
onClick={this.onHeaderClick}
onContextMenu={this.onContextMenu}
title={this.props.isMinimized ? this.props.label : undefined}