[MM-61599]: Remove tabIndex from non-interactive elements (#29659)

Этот коммит содержится в:
Saurabh Sharma
2025-01-31 21:54:56 +05:30
коммит произвёл GitHub
родитель 7740eb9d43
Коммит 7a959038f9
11 изменённых файлов: 26 добавлений и 54 удалений

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

@@ -157,8 +157,7 @@ describe('Verify Accessibility Support in Post', () => {
postMessages(testChannel, otherUser, 1);
// # Shift focus to the last post
cy.get('#FormattingControl_bold').focus().tab({shift: true}).tab({shift: true}).type('{uparrow}{downarrow}');
cy.focused().tab();
cy.get('#FormattingControl_bold').focus().tab({shift: true}).tab({shift: true}).tab({shift: true}).tab({shift: true});
cy.getLastPostId().then((postId) => {
cy.get(`#post_${postId}`).within(() => {
@@ -199,9 +198,6 @@ describe('Verify Accessibility Support in Post', () => {
// * Verify focus is on the more button
cy.get(`#CENTER_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more');
cy.focused().tab();
// * Verify focus is on the post text
cy.get(`#postMessageText_${postId}`).should('be.focused');
});
});
});
@@ -230,36 +226,32 @@ describe('Verify Accessibility Support in Post', () => {
// * Verify reverse tab on RHS
cy.getLastPostId().then((postId) => {
cy.get(`#rhsPost_${postId}`).within(() => {
// * Verify focus is on the post text
cy.get(`#rhsPostMessageText_${postId}`).should('be.focused');
cy.focused().tab({shift: true});
// * Verify focus is on the more button
cy.get(`#RHS_COMMENT_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more');
cy.focused().tab({shift: true});
// * Verify focus is on the actions button
cy.get(`#RHS_COMMENT_actions_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'actions');
cy.focused().tab({shift: true});
// * Verify focus is on the save icon
cy.get(`#RHS_COMMENT_flagIcon_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'save message');
cy.focused().tab({shift: true});
// * Verify focus is on the reactions button
cy.get(`#RHS_COMMENT_reaction_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'Add Reaction');
cy.focused().tab({shift: true});
// * Verify focus is on most recent action
cy.get('#recent_reaction_0').should('have.class', 'emoticon--post-menu').and('have.attr', 'aria-label');
cy.focused().tab({shift: true});
// * Verify focus is on the time
cy.get(`#RHS_COMMENT_time_${postId}`).should('be.focused');
cy.focused().tab({shift: true});
// * Verify focus is on the username
cy.get('button.user-popover').should('be.focused');
cy.focused().tab().tab();
// * Verify focus is on most recent action
cy.get('#recent_reaction_0').should('have.class', 'emoticon--post-menu').and('have.attr', 'aria-label');
cy.focused().tab();
// * Verify focus is on the reactions button
cy.get(`#RHS_COMMENT_reaction_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'Add Reaction');
cy.focused().tab();
// * Verify focus is on the save icon
cy.get(`#RHS_COMMENT_flagIcon_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'save message');
cy.focused().tab();
// * Verify focus is on the actions button
cy.get(`#RHS_COMMENT_actions_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'actions');
cy.focused().tab();
// * Verify focus is on the more button
cy.get(`#RHS_COMMENT_button_${postId}`).should('be.focused').and('have.attr', 'aria-label', 'more');
cy.focused().tab({shift: true});
});
});

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

@@ -231,7 +231,7 @@ describe('Verify Accessibility Support in different input fields', () => {
cy.get('#rhsContainer').within(() => {
// * Verify Accessibility Support in RHS input
cy.uiGetReplyTextBox().should('have.attr', 'placeholder', 'Reply to this thread...').and('have.attr', 'role', 'textbox').focus().type('test').tab({shift: true}).tab().tab();
cy.uiGetReplyTextBox().should('have.attr', 'placeholder', 'Reply to this thread...').and('have.attr', 'role', 'textbox').focus().type('test').tab();
// * Verify if the focus is on the preview button
cy.get('#PreviewInputTextButton').should('be.focused').and('have.attr', 'aria-label', 'preview').tab();

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

@@ -10,7 +10,7 @@
// Stage: @prod
// Group: @channels @mark_as_unread
import {notShowCursor, markAsUnreadShouldBeAbsent} from './helpers';
import {markAsUnreadShouldBeAbsent} from './helpers';
describe('Channels', () => {
let testUser;
@@ -75,12 +75,6 @@ describe('Channels', () => {
// * Verify the "Mark as Unread" option is absent in post menu
markAsUnreadShouldBeAbsent(post1.id);
// * Hover on the post with holding alt should show cursor
cy.get(`#post_${post1.id}`).trigger('mouseover').type('{alt}', {release: false}).should(notShowCursor);
// # Mouse click on the post holding alt
cy.get(`#post_${post1.id}`).type('{alt}', {release: false}).click();
// * Verify the post is not marked as unread
cy.get('.NotificationSeparator').should('not.exist');
});

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

@@ -61,8 +61,8 @@ describe('Mark as Unread', () => {
// * Hover on the post with holding alt should show cursor
cy.get(`#post_${post2.id}`).trigger('mouseover').type('{alt}', {release: false}).should(showCursor);
// # Mouse click on the post holding alt
cy.get(`#post_${post2.id}`).type('{alt}', {release: false}).click();
// # Mouse click on the post
cy.get(`#post_${post2.id}`).click();
// * Verify the post is marked as unread
verifyPostNextToNewMessageSeparator('post2');

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

@@ -63,11 +63,7 @@ describe('Emoji reactions to posts/messages in GM channels', () => {
// * Verify that the Add Reaction button isn't visible
cy.findByLabelText('Add a reaction').should('not.be.visible');
// # Focus on the post since we can't hover with Cypress
cy.get(`#post_${postId}`).focus().tab().tab();
// * Verify that the Add Reaction button is now visible
cy.findByLabelText('Add a reaction').should('be.visible');
cy.get(`#post_${postId}`).trigger('mouseover');
// # Click somewhere to clear the focus
cy.get('#channelIntro').click();