Skip to content

Commit 3c7422e

Browse files
committed
fix(EditRoomInfo): align system-messages MultiSelect with new fuselage a11y
The MultiSelect anchor in @rocket.chat/fuselage now exposes role="combobox" and uses aria-label/aria-labelledby for its accessible name (the placeholder is rendered as inert children). The recently added EditRoomInfo.spec.tsx was written against the previous fuselage where the anchor was a plain button named by its placeholder, so getByRole('button', { name: /Select messages to hide/i }) no longer matches and CI's Unit Tests fail on develop. - Pass aria-label to the MultiSelect so the combobox has an accessible name. - Update the spec helper to query by the combobox role.
1 parent aed3c5d commit 3c7422e

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Adds an accessible label to the system-messages multi-select in the channel edit panel so screen readers announce its purpose.

apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const removeSystemMessageChip = async (translationKey: string) => {
6464
};
6565

6666
const selectSystemMessageOption = async (translationKey: string) => {
67-
const trigger = screen.getByRole('button', { name: /Select messages to hide/i });
67+
const trigger = screen.getByRole('combobox', { name: /Select messages to hide/i });
6868
await userEvent.click(trigger);
6969

7070
const listboxes = await screen.findAllByRole('listbox', { hidden: true });

apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
483483
options={sysMesOptions}
484484
disabled={!hideSysMes || isFederated}
485485
placeholder={t('Select_messages_to_hide')}
486+
aria-label={t('Select_messages_to_hide')}
486487
/>
487488
)}
488489
/>

0 commit comments

Comments
 (0)