[MM-55285]: Screen reader speaking wrong item in list in Find Channels modal (#29552)

* [MA-11]: Fix Screen reader speaking wrong item in list in Find Channels modal

* [MA-11]: Update types across files

* [MA-11]: Minor refactoring

* [MA-11]: Fix e2e test

* [MA-11]: Fix E2E tests

* [MA-11]: Update role and id

* [MA-11]: Fix playwright tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Saurabh Sharma
2025-01-17 01:05:13 +05:30
коммит произвёл GitHub
родитель 540408545a
Коммит 132c27fb34
38 изменённых файлов: 120 добавлений и 76 удалений

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

@@ -42,7 +42,7 @@ describe('Channel Switcher', () => {
// # Start typing channel name in the "Switch Channels" modal message box
// # Use up/down arrow keys to highlight second channel
// # Press ENTER
cy.findByRole('textbox', {name: 'quick switch input'}).
cy.findByRole('combobox', {name: 'quick switch input'}).
type(`${channelDisplayNamePrefix} `).
type('{downarrow}{downarrow}{enter}');
@@ -60,7 +60,7 @@ describe('Channel Switcher', () => {
cy.typeCmdOrCtrl().type('K', {release: true});
// # Start typing channel name in the "Switch Channels" modal message box
cy.findByRole('textbox', {name: 'quick switch input'}).type(`${channelDisplayNamePrefix} `);
cy.findByRole('combobox', {name: 'quick switch input'}).type(`${channelDisplayNamePrefix} `);
cy.get(`[data-testid^=${channelNamePrefix}-c] > span`).click();
@@ -78,7 +78,7 @@ describe('Channel Switcher', () => {
cy.typeCmdOrCtrl().type('K', {release: true});
// # Type invalid channel name in the "Switch Channels" modal message box
cy.findByRole('textbox', {name: 'quick switch input'}).type('there-is-no-spoon');
cy.findByRole('combobox', {name: 'quick switch input'}).type('there-is-no-spoon');
// * Expect 'nothing found' message
cy.get('.no-results__title > span').should('be.visible');
@@ -91,10 +91,10 @@ describe('Channel Switcher', () => {
cy.typeCmdOrCtrl().type('K', {release: true});
// # Press ESC
cy.findByRole('textbox', {name: 'quick switch input'}).type('{esc}');
cy.findByRole('combobox', {name: 'quick switch input'}).type('{esc}');
// * Expect the dialog to be closed
cy.findByRole('textbox', {name: 'quick switch input'}).should('not.exist');
cy.findByRole('combobox', {name: 'quick switch input'}).should('not.exist');
// * Expect staying in the same channel
cy.url().should('contain', 'off-topic');
@@ -106,7 +106,7 @@ describe('Channel Switcher', () => {
cy.get('.modal').click({force: true});
// * Expect the dialog to be closed
cy.findByRole('textbox', {name: 'quick switch input'}).should('not.exist');
cy.findByRole('combobox', {name: 'quick switch input'}).should('not.exist');
// * Expect staying in the same channel
cy.url().should('contain', 'off-topic');