[MM-61631]: Remove focusable child descendants (#29745)

* [MA-37]: Remove focusable child descendants

* [MA-37]: Fix E2E tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Saurabh Sharma
2025-01-24 20:22:16 +05:30
коммит произвёл GitHub
родитель 0dd436d3fb
Коммит 54207acd6a
4 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@@ -152,7 +152,7 @@ describe('Integrations', () => {
cy.uiWaitUntilMessagePostedIncludes(firstMessage);
// * The user stays in the same team
cy.get(`#${team1.name}TeamButton`).parent().should('have.class', 'active');
cy.get(`#${team1.name}TeamButton`).children().should('have.class', 'active');
// * The user is in the DM channel with user2
cy.get(`#sidebarItem_${Cypress._.sortBy([user1.id, user2.id]).join('__')}`).parent().should('be.visible').and('have.class', 'active');
@@ -168,7 +168,7 @@ describe('Integrations', () => {
cy.uiWaitUntilMessagePostedIncludes(secondMessage);
// * The user stays in the same team
cy.get(`#${team2.name}TeamButton`).parent().should('have.class', 'active');
cy.get(`#${team2.name}TeamButton`).children().should('have.class', 'active');
// * The user is in the DM channel with user2
cy.get(`#sidebarItem_${Cypress._.sortBy([user1.id, user2.id]).join('__')}`).parent().should('be.visible').and('have.class', 'active');

Просмотреть файл

@@ -142,7 +142,7 @@ describe('Send a DM', () => {
// * Dot appears, with no number (just unread, not a mention)
cy.apiLogin(userA);
cy.visit(offTopicUrlB);
cy.get(`#${teamA.name}TeamButton`).parent('.unread').should('be.visible');
cy.get(`#${teamA.name}TeamButton`).children('.unread').should('be.visible');
cy.get(`#${teamA.name}TeamButton`).should('be.visible').within(() => {
cy.get('.badge').should('not.exist');
});

Просмотреть файл

@@ -179,20 +179,23 @@ export default function TeamButton({
>
{(provided, snapshot) => {
return (
<div
className='draggable-team-container'
<Link
to={url}
id={`${url.slice(1)}TeamButton`}
aria-label={ariaLabel}
onClick={handleSwitch}
className='draggable-team-container inline-block'
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
tabIndex={-1}
>
<div
className={classNames([`team-container ${teamClass}`, {isDragging: snapshot.isDragging}])}
>
{teamButton}
{btn}
{orderIndicator}
</div>
</div>
</Link>
);
}}
</Draggable>

Просмотреть файл

@@ -32,9 +32,14 @@
.draggable-team-container {
position: relative;
display: inline-block;
margin-right: auto;
margin-bottom: 12px;
margin-left: auto;
&:hover, &:focus {
text-decoration: none;
}
}
.team-container {