diff --git a/packages/legacy/core/App/components/buttons/ToggleButton.tsx b/packages/legacy/core/App/components/buttons/ToggleButton.tsx index dc6f41f8f6..79f2fe21f4 100644 --- a/packages/legacy/core/App/components/buttons/ToggleButton.tsx +++ b/packages/legacy/core/App/components/buttons/ToggleButton.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react' import { Pressable, Animated } from 'react-native' import Icon from 'react-native-vector-icons/MaterialIcons' import { useTheme } from '../../contexts/theme' +import { useTranslation } from 'react-i18next' interface ToggleButtonProps { isEnabled: boolean @@ -24,6 +25,7 @@ const ToggleButton: React.FC = ({ }) => { const { ColorPallet } = useTheme() const [toggleAnim] = useState(new Animated.Value(isEnabled ? 1 : 0)) + const { t } = useTranslation() useEffect(() => { Animated.timing(toggleAnim, { @@ -47,7 +49,7 @@ const ToggleButton: React.FC = ({ = ({ actions, onDismiss }) => { key={action.text} testID={testIdWithKey(action.text)} accessibilityLabel={testIdWithKey(action.text)} + accessibilityRole="button" style={styles.drawerRow} onPress={action.onPress} > diff --git a/packages/legacy/core/App/components/chat/ChatMessage.tsx b/packages/legacy/core/App/components/chat/ChatMessage.tsx index 85740b650e..b7ece6ff62 100644 --- a/packages/legacy/core/App/components/chat/ChatMessage.tsx +++ b/packages/legacy/core/App/components/chat/ChatMessage.tsx @@ -121,6 +121,7 @@ export const ChatMessage: React.FC = ({ messageProps }) => { {message.messageOpensCallbackType && ( { if (message.onDetails) message.onDetails() diff --git a/packages/legacy/core/App/components/inputs/CheckBoxRow.tsx b/packages/legacy/core/App/components/inputs/CheckBoxRow.tsx index 9a5a62276a..3127761d9f 100644 --- a/packages/legacy/core/App/components/inputs/CheckBoxRow.tsx +++ b/packages/legacy/core/App/components/inputs/CheckBoxRow.tsx @@ -46,6 +46,8 @@ const CheckBoxRow: React.FC = ({ = ({ contact, navigation } onPress={navigateToContact} testID={testIdWithKey('Contact')} accessibilityLabel={t('ContactDetails.AContact')} + accessibilityRole="button" > diff --git a/packages/legacy/core/App/components/misc/InfoBox.tsx b/packages/legacy/core/App/components/misc/InfoBox.tsx index c5a0494266..caef7a9659 100644 --- a/packages/legacy/core/App/components/misc/InfoBox.tsx +++ b/packages/legacy/core/App/components/misc/InfoBox.tsx @@ -223,6 +223,7 @@ const InfoBox: React.FC = ({ {message && !showDetails && (showDetailsInfo ?? true) && ( = ({ )} {showVersionFooter ? ( - + {`${t('Settings.Version')} ${getVersion()} (${getBuildNumber()})`} ) : null} diff --git a/packages/legacy/core/App/components/misc/NewQRView.tsx b/packages/legacy/core/App/components/misc/NewQRView.tsx index 20948f65b1..3fb03f44c5 100644 --- a/packages/legacy/core/App/components/misc/NewQRView.tsx +++ b/packages/legacy/core/App/components/misc/NewQRView.tsx @@ -327,7 +327,7 @@ const NewQRView: React.FC = ({ defaultToConnect, handleCodeScan, error, e )} - + = ({ onPress, active, iconName, title }) = style={styles.container} onPress={onPress} accessibilityLabel={title} + accessibilityRole="tab" testID={testIdWithKey(title)} > diff --git a/packages/legacy/core/App/components/misc/VerifierCredentialCard.tsx b/packages/legacy/core/App/components/misc/VerifierCredentialCard.tsx index ef2e575639..5054da6caa 100644 --- a/packages/legacy/core/App/components/misc/VerifierCredentialCard.tsx +++ b/packages/legacy/core/App/components/misc/VerifierCredentialCard.tsx @@ -139,7 +139,7 @@ const VerifierCredentialCard: React.FC = ({ language: i18n.language, } bundleResolver.resolveAllBundles(params).then((bundle) => { - setOverlay(o => ({ + setOverlay((o) => ({ ...o, ...bundle, brandingOverlay: bundle.brandingOverlay as BrandingOverlay, @@ -185,7 +185,7 @@ const VerifierCredentialCard: React.FC = ({ const [showImageModal, setShowImageModal] = useState(false) useEffect(() => { - setValue(v => formatIfDate(item.format, v)) + setValue((v) => formatIfDate(item.format, v)) }, [item.format]) return ( @@ -208,6 +208,7 @@ const VerifierCredentialCard: React.FC = ({ {isDataUrl(value) ? ( setShowImageModal(true)} > diff --git a/packages/legacy/core/App/components/modals/AppGuideModal.tsx b/packages/legacy/core/App/components/modals/AppGuideModal.tsx index 06e4a639da..aeb08c0d94 100644 --- a/packages/legacy/core/App/components/modals/AppGuideModal.tsx +++ b/packages/legacy/core/App/components/modals/AppGuideModal.tsx @@ -79,7 +79,7 @@ const AppGuideModal: React.FC = ({ }) return ( - + diff --git a/packages/legacy/core/App/components/record/Record.tsx b/packages/legacy/core/App/components/record/Record.tsx index 89fef2342b..0836f00bee 100644 --- a/packages/legacy/core/App/components/record/Record.tsx +++ b/packages/legacy/core/App/components/record/Record.tsx @@ -79,6 +79,7 @@ const Record: React.FC = ({ header, footer, fields, hideFieldValues testID={testIdWithKey('HideAll')} accessible={true} accessibilityLabel={t('Record.HideAll')} + accessibilityRole="button" > {t('Record.HideAll')} diff --git a/packages/legacy/core/App/components/record/RecordBinaryField.tsx b/packages/legacy/core/App/components/record/RecordBinaryField.tsx index b6ffd24cec..993b12d477 100644 --- a/packages/legacy/core/App/components/record/RecordBinaryField.tsx +++ b/packages/legacy/core/App/components/record/RecordBinaryField.tsx @@ -37,6 +37,7 @@ const RecordBinaryField: React.FC = ({ attributeValue, s accessibilityLabel={t('Record.Zoom')} testID={testIdWithKey('zoom')} onPress={() => setShowImageModal(true)} + accessibilityRole="imagebutton" > diff --git a/packages/legacy/core/App/components/record/RecordField.tsx b/packages/legacy/core/App/components/record/RecordField.tsx index 324169fad9..b5d5397540 100644 --- a/packages/legacy/core/App/components/record/RecordField.tsx +++ b/packages/legacy/core/App/components/record/RecordField.tsx @@ -107,6 +107,7 @@ const RecordField: React.FC = ({ = ({ children }) => { }) return ( - + {children} ) diff --git a/packages/legacy/core/App/components/tour/TourOverlay.tsx b/packages/legacy/core/App/components/tour/TourOverlay.tsx index 00edc84bdb..a853ee5d93 100644 --- a/packages/legacy/core/App/components/tour/TourOverlay.tsx +++ b/packages/legacy/core/App/components/tour/TourOverlay.tsx @@ -85,7 +85,11 @@ export const TourOverlay = (props: TourOverlayProps) => { }, [windowWidth, windowHeight]) return currentStep !== undefined ? ( - + - + {bgImage ? : null} diff --git a/packages/legacy/core/App/modules/openid/components/OpenIDCredentialCard.tsx b/packages/legacy/core/App/modules/openid/components/OpenIDCredentialCard.tsx index bc36f607b4..5a9e392b3c 100644 --- a/packages/legacy/core/App/modules/openid/components/OpenIDCredentialCard.tsx +++ b/packages/legacy/core/App/modules/openid/components/OpenIDCredentialCard.tsx @@ -227,6 +227,7 @@ const OpenIDCredentialCard: React.FC = ({ accessibilityLabel={`${display?.issuer.name ? `${t('Credentials.IssuedBy')} ${display?.issuer.name}` : ''}, ${t( 'Credentials.Credential' )}.`} + accessibilityRole="button" disabled={typeof onPress === 'undefined' ? true : false} onPress={onPress} style={[styles.container, style]} diff --git a/packages/legacy/core/App/screens/Language.tsx b/packages/legacy/core/App/screens/Language.tsx index a558a1a814..716799537a 100644 --- a/packages/legacy/core/App/screens/Language.tsx +++ b/packages/legacy/core/App/screens/Language.tsx @@ -67,7 +67,9 @@ const Language = () => { {value} = ({ navigation, templ style={style.card} onPress={() => navigation.navigate(Screens.ProofRequestDetails, { templateId: template.id, connectionId })} accessibilityLabel={t('Screens.ProofRequestDetails')} + accessibilityRole="button" testID={testIdWithKey('ProofRequestsCard')} > diff --git a/packages/legacy/core/App/screens/ProofChangeCredential.tsx b/packages/legacy/core/App/screens/ProofChangeCredential.tsx index 2bd1d6c6f5..c173c47986 100644 --- a/packages/legacy/core/App/screens/ProofChangeCredential.tsx +++ b/packages/legacy/core/App/screens/ProofChangeCredential.tsx @@ -153,6 +153,7 @@ const ProofChangeCredential: React.FC = ({ route, navigation } return ( changeCred(item.credId ?? '')} style={[item.credId === selectedCred ? styles.selectedCred : undefined, { marginBottom: 10 }]} diff --git a/packages/legacy/core/App/screens/ProofRequestUsageHistory.tsx b/packages/legacy/core/App/screens/ProofRequestUsageHistory.tsx index aabc45230a..3c41c4e92d 100644 --- a/packages/legacy/core/App/screens/ProofRequestUsageHistory.tsx +++ b/packages/legacy/core/App/screens/ProofRequestUsageHistory.tsx @@ -98,6 +98,7 @@ const ProofRequestUsageHistoryRecord: React.FC diff --git a/packages/legacy/core/App/screens/Settings.tsx b/packages/legacy/core/App/screens/Settings.tsx index 49038ab294..eb80c5fbe8 100644 --- a/packages/legacy/core/App/screens/Settings.tsx +++ b/packages/legacy/core/App/screens/Settings.tsx @@ -339,6 +339,7 @@ const Settings: React.FC = ({ navigation }) => { { minHeight: 200, marginBottom: 66, }, + biometryAvailableRowGap: { + rowGap: 20, + }, }) useEffect(() => { @@ -281,18 +284,16 @@ const UseBiometry: React.FC = () => { {biometryAvailable ? ( - + {t('Biometry.EnabledText1')} - {t('Biometry.EnabledText2')} {t('Biometry.Warning')} ) : ( - + {t('Biometry.NotEnabledText1')} - {t('Biometry.NotEnabledText2')} )} diff --git a/packages/legacy/core/__tests__/components/__snapshots__/ChatMessage.test.tsx.snap b/packages/legacy/core/__tests__/components/__snapshots__/ChatMessage.test.tsx.snap index 0c1082c1ba..90ae5297be 100644 --- a/packages/legacy/core/__tests__/components/__snapshots__/ChatMessage.test.tsx.snap +++ b/packages/legacy/core/__tests__/components/__snapshots__/ChatMessage.test.tsx.snap @@ -123,7 +123,7 @@ exports[`ChatMessage Credential offer renders correctly 1`] = ` ] } > - Jan 1, 12:00 am + Jan 1, 2024, 12:00 am @@ -131,6 +131,7 @@ exports[`ChatMessage Credential offer renders correctly 1`] = ` - Jan 1, 12:00 am + Jan 1, 2024, 12:00 am @@ -332,6 +333,7 @@ exports[`ChatMessage Proof request renders correctly 1`] = ` - Jan 1, 12:00 am + Jan 1, 2024, 12:00 am @@ -533,6 +535,7 @@ exports[`ChatMessage Sent presentation renders correctly 1`] = ` require('react-native-permissions/mock')) -const mockedCheck = check as jest.MockedFunction; -const mockedRequest = request as jest.MockedFunction; +const mockedCheck = check as jest.MockedFunction +const mockedRequest = request as jest.MockedFunction jest.spyOn(Linking, 'openSettings').mockImplementation(() => Promise.resolve()) @@ -22,14 +22,14 @@ const customStore = { ...testDefaultState, preferences: { ...testDefaultState.preferences, - useBiometry: false + useBiometry: false, }, } describe('UseBiometry Screen', () => { beforeAll(() => { // eslint-disable-next-line @typescript-eslint/no-empty-function - jest.spyOn(global.console, 'error').mockImplementation(() => { }) + jest.spyOn(global.console, 'error').mockImplementation(() => {}) }) beforeEach(() => { @@ -110,7 +110,7 @@ describe('UseBiometry Screen', () => { const { getByTestId } = render( - + ) @@ -141,17 +141,17 @@ describe('UseBiometry Screen', () => { // and biometric is not available customStore.preferences.useBiometry = true authContext.isBiometricsActive = jest.fn().mockResolvedValueOnce(false) - + const { getByTestId } = render( - + ) - + const toggleButton = getByTestId(testIdWithKey('ToggleBiometrics')) await waitFor(() => { @@ -168,7 +168,7 @@ describe('UseBiometry Screen', () => { - + @@ -190,7 +190,7 @@ describe('UseBiometry Screen', () => { - + @@ -215,7 +215,7 @@ describe('UseBiometry Screen', () => { - + @@ -241,7 +241,7 @@ describe('UseBiometry Screen', () => { - + @@ -292,7 +292,7 @@ describe('UseBiometry Screen', () => { - + diff --git a/packages/legacy/core/__tests__/screens/__snapshots__/ListContacts.test.tsx.snap b/packages/legacy/core/__tests__/screens/__snapshots__/ListContacts.test.tsx.snap index f88deee93e..27f8d58e98 100644 --- a/packages/legacy/core/__tests__/screens/__snapshots__/ListContacts.test.tsx.snap +++ b/packages/legacy/core/__tests__/screens/__snapshots__/ListContacts.test.tsx.snap @@ -108,6 +108,7 @@ exports[`ListContacts Screen Renders correctly 1`] = ` > - + Biometry.EnabledText1 - - + Biometry.NotEnabledText1 - - + Biometry.EnabledText1 -