From 3c097d15339db15d11f8f6c67428e391a00cf640 Mon Sep 17 00:00:00 2001 From: Melissa Hart <48496458+MelissaDTH@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:09:21 +0100 Subject: [PATCH] feat(a11y): apply correct aria attributes and improve searchbar (#117) --- .../src/components/CollapsibleText/CollapsibleText.tsx | 2 ++ .../__snapshots__/CollapsibleText.test.tsx.snap | 1 + packages/ui-react/src/components/Header/Header.tsx | 7 ++++--- .../components/Header/__snapshots__/Header.test.tsx.snap | 2 ++ .../ui-react/src/components/LanguageMenu/LanguageMenu.tsx | 1 + .../LanguageMenu/__snapshots__/LanguageMenu.test.tsx.snap | 1 + .../src/components/SearchBar/SearchBar.module.scss | 4 ++++ packages/ui-react/src/components/SearchBar/SearchBar.tsx | 2 +- .../SearchBar/__snapshots__/SearchBar.test.tsx.snap | 2 +- .../VideoDetails/__snapshots__/VideoDetails.test.tsx.snap | 1 + .../src/containers/FavoriteButton/FavoriteButton.tsx | 1 + 11 files changed, 19 insertions(+), 5 deletions(-) diff --git a/packages/ui-react/src/components/CollapsibleText/CollapsibleText.tsx b/packages/ui-react/src/components/CollapsibleText/CollapsibleText.tsx index 3cd73db23..8656584af 100644 --- a/packages/ui-react/src/components/CollapsibleText/CollapsibleText.tsx +++ b/packages/ui-react/src/components/CollapsibleText/CollapsibleText.tsx @@ -35,6 +35,7 @@ const CollapsibleText: React.FC = ({ text, className, maxHeight = 'none'

@@ -44,6 +45,7 @@ const CollapsibleText: React.FC = ({ text, className, maxHeight = 'none' setExpanded(!expanded)} > diff --git a/packages/ui-react/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap b/packages/ui-react/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap index 72e97167b..101afed39 100644 --- a/packages/ui-react/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap +++ b/packages/ui-react/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap @@ -7,6 +7,7 @@ exports[` > renders and matches snapshot 1`] = ` >

Test... diff --git a/packages/ui-react/src/components/Header/Header.tsx b/packages/ui-react/src/components/Header/Header.tsx index e3ded9202..54738f60d 100644 --- a/packages/ui-react/src/components/Header/Header.tsx +++ b/packages/ui-react/src/components/Header/Header.tsx @@ -133,6 +133,7 @@ const Header: React.FC = ({ aria-label={t('open_user_menu')} aria-controls="user_menu_panel" aria-expanded={userMenuOpen} + aria-haspopup="menu" onClick={openUserMenu} onBlur={closeUserMenu} > @@ -163,8 +164,8 @@ const Header: React.FC = ({ ) : (

-
); }; @@ -200,7 +201,7 @@ const Header: React.FC = ({ aria-controls="sidebar" aria-haspopup="true" aria-expanded={sideBarOpen} - onClick={onMenuButtonClick} + onClick={() => onMenuButtonClick()} > diff --git a/packages/ui-react/src/components/Header/__snapshots__/Header.test.tsx.snap b/packages/ui-react/src/components/Header/__snapshots__/Header.test.tsx.snap index c22e2094a..baeb35dd9 100644 --- a/packages/ui-react/src/components/Header/__snapshots__/Header.test.tsx.snap +++ b/packages/ui-react/src/components/Header/__snapshots__/Header.test.tsx.snap @@ -71,6 +71,7 @@ exports[`
> renders header 1`] = ` class="_buttonContainer_f4f7a7" >