From 883711c72db49bbc9abe86bde320ae146dd99730 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Mon, 12 May 2025 09:14:20 -0400 Subject: [PATCH] [MM-62973][MM-63028][MM-63034][MM-63027] Various accessibility fixes around Browse Channels modal (#30922) * [MM-62973] Fix order of Close button and other buttons in the header * [MM-63028] Add aria-live status area when searching for channels * [MM-63027] Add announcement that channel is joined * [MM-63034] Add role=checkbox and reformat HTML to have correct custom checkbox code * Update snapshots from generic_modal change * PR feedback * PR feedback * PR feedback --- .../channel/browse_public_channels_spec.ts | 4 +- .../accessibility_modals_dialogs_spec.ts | 4 +- .../searchable_channel_list.test.tsx.snap | 8 +- .../channel_notifications_modal.test.tsx.snap | 192 +++++++++--------- .../marketplace_modal.test.tsx.snap | 154 +++++++++++++- .../components/searchable_channel_list.tsx | 40 +++- webapp/channels/src/i18n/en.json | 4 +- .../__snapshots__/generic_modal.test.tsx.snap | 6 +- .../src/generic_modal/generic_modal.tsx | 19 +- 9 files changed, 310 insertions(+), 121 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/channel/browse_public_channels_spec.ts b/e2e-tests/cypress/tests/integration/channels/channel/browse_public_channels_spec.ts index 29c83de595..f41b237d96 100644 --- a/e2e-tests/cypress/tests/integration/channels/channel/browse_public_channels_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/channel/browse_public_channels_spec.ts @@ -20,12 +20,12 @@ function verifyNoChannelToJoinMessage(isVisible) { function ensureHideJoinedCheckboxEnabled(shouldBeChecked) { cy.get('#hideJoinedPreferenceCheckbox').then(($checkbox) => { cy.wrap($checkbox).findByText('Hide Joined').should('be.visible'); - cy.wrap($checkbox).find('button').invoke('attr', 'class').then(($classList) => { + cy.wrap($checkbox).find('div.get-app__checkbox').invoke('attr', 'class').then(($classList) => { if ($classList.split(' ').includes('checked') ^ shouldBeChecked) { // We click on the button only when the XOR operands do not match // e.g. checkbox is checked, but should not be checked; and vice-versa cy.wrap($checkbox).click(); - cy.wrap($checkbox).find('button').should(`${shouldBeChecked ? '' : 'not.'}have.class`, 'checked'); + cy.wrap($checkbox).find('div.get-app__checkbox').should(`${shouldBeChecked ? '' : 'not.'}have.class`, 'checked'); } }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts index 9ae67a9b1a..5f81f65b83 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts @@ -120,8 +120,8 @@ describe('Verify Accessibility Support in Modals & Dialogs', () => { // # Hide already joined channels cy.findByText('Hide Joined').click(); - // # Focus on the Create Channel button and TAB four time - cy.get('#createNewChannelButton').focus().tab().tab().tab().tab(); + // # Focus on the Create Channel button and TAB five time + cy.get('#createNewChannelButton').focus().tab().tab().tab().tab().tab(); // * Verify channel name is highlighted and reader reads the channel name and channel description cy.get('#moreChannelsList').within(() => { diff --git a/webapp/channels/src/components/__snapshots__/searchable_channel_list.test.tsx.snap b/webapp/channels/src/components/__snapshots__/searchable_channel_list.test.tsx.snap index fa68f91cae..d920d319dc 100644 --- a/webapp/channels/src/components/__snapshots__/searchable_channel_list.test.tsx.snap +++ b/webapp/channels/src/components/__snapshots__/searchable_channel_list.test.tsx.snap @@ -121,11 +121,15 @@ exports[`components/SearchableChannelList should match init snapshot 1`] = ` />