From 70eff9c1c4a0aceebe87353e70f90d115062261b Mon Sep 17 00:00:00 2001 From: Brian August Nguyen Date: Tue, 27 Feb 2024 16:32:05 -0800 Subject: [PATCH] fix: Updated accessibility role for buttons (#8753) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** - Updated accessibility role for buttons and text inside buttons - Enabled 'Text' to accept accessibilityRole ## **Related issues** Fixes: #8630 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- .../CustomSpendCap.test.tsx.snap | 6 +++-- .../Banner/__snapshots__/Banner.test.tsx.snap | 4 ++++ .../__snapshots__/BannerAlert.test.tsx.snap | 3 ++- .../__snapshots__/BannerTip.test.tsx.snap | 3 ++- .../BottomSheetFooter.test.tsx.snap | 4 ++++ .../foundation/ButtonBase/ButtonBase.tsx | 3 +++ .../__snapshots__/ButtonBase.test.tsx.snap | 6 +++++ .../Button/variants/ButtonLink/ButtonLink.tsx | 1 + .../__snapshots__/ButtonLink.test.tsx.snap | 1 + .../components/Texts/Text/Text.tsx | 2 +- .../CollectibleModal.test.tsx.snap | 2 ++ .../__snapshots__/index.test.tsx.snap | 4 ++++ .../NetworkVerificationInfo.test.tsx.snap | 4 ++++ .../NetworkSwitcher.test.tsx.snap | 4 ++++ .../Tokens/__snapshots__/index.test.tsx.snap | 6 +++++ .../EditAccountName.test.tsx.snap | 4 ++++ .../NetworkSelector.test.tsx.snap | 2 ++ .../__snapshots__/index.test.tsx.snap | 5 +++- .../BlockaidIndicator.test.tsx.snap | 12 ++++++++++ .../SecuritySettings.test.tsx.snap | 24 +++++++++++++++++-- .../ShowDisplayNFTMediaSheet.test.tsx.snap | 4 ++++ .../ShowIpfsGatewaySheet.test.tsx.snap | 4 ++++ .../ApprovalResult.test.tsx.snap | 4 ++++ 23 files changed, 104 insertions(+), 8 deletions(-) diff --git a/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap b/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap index 070f6a317e0..c59cb885be7 100644 --- a/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap +++ b/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap @@ -89,7 +89,8 @@ exports[`CustomSpendCap should match snapshot 1`] = ` {startIconName && ( @@ -59,6 +61,7 @@ const ButtonBase = ({ {label} diff --git a/app/component-library/components/Buttons/Button/foundation/ButtonBase/__snapshots__/ButtonBase.test.tsx.snap b/app/component-library/components/Buttons/Button/foundation/ButtonBase/__snapshots__/ButtonBase.test.tsx.snap index 08320150ea7..3532252e95d 100644 --- a/app/component-library/components/Buttons/Button/foundation/ButtonBase/__snapshots__/ButtonBase.test.tsx.snap +++ b/app/component-library/components/Buttons/Button/foundation/ButtonBase/__snapshots__/ButtonBase.test.tsx.snap @@ -2,6 +2,8 @@ exports[`ButtonBase should render correctly 1`] = ` = ({ onPressIn={triggerOnPressedIn} onPressOut={triggerOnPressedOut} accessibilityRole="link" + accessible {...props} > {renderLabel()} diff --git a/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap b/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap index e61087c330c..e010f07fb29 100644 --- a/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap +++ b/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap @@ -4,6 +4,7 @@ exports[`Link should render correctly 1`] = ` = ({ }) => { const { styles } = useStyles(styleSheet, { variant, style, color }); return ( - + {children} ); diff --git a/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap b/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap index d2fca929ba7..cec47e30a5b 100644 --- a/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap +++ b/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap @@ -192,6 +192,8 @@ exports[`CollectibleModal should render correctly 1`] = ` } >