From bcc91c37337057405fe83e0c48ad625f7914db0f Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 24 Apr 2025 15:46:04 -0700 Subject: [PATCH] Add Maestro `testID` support in `NotificationCard` --- CHANGELOG.md | 1 + src/components/notification/NotificationCard.tsx | 7 ++++--- src/components/notification/NotificationView.tsx | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e76f2d791ee..30a2835dd4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - added: Add PIVX. - added: Monero multi output support. - added: Moonpay Sell support for ACH. +- added: Maestro `testID` support in `NotificationCard` - fixed: `SceneWrapper` bottom inset calculations for scenes that do not `avoidKeyboard` ## 4.26.0 (2025-04-14) diff --git a/src/components/notification/NotificationCard.tsx b/src/components/notification/NotificationCard.tsx index c1dab49bf56..99a18a6064b 100644 --- a/src/components/notification/NotificationCard.tsx +++ b/src/components/notification/NotificationCard.tsx @@ -22,6 +22,7 @@ interface Props { * visible if the body is tapped. Default false. */ persistent?: boolean iconUri?: string + testID?: string onPress: () => void | Promise @@ -33,7 +34,7 @@ const NotificationCardComponent = (props: Props) => { const theme = useTheme() const styles = getStyles(theme) - const { title, type, message, persistent = false, onClose, onPress } = props + const { title, type, message, persistent = false, testID, onClose, onPress } = props const { iconUri = type === 'warning' ? getThemedIconUri(theme, 'notifications/icon-warning') : getThemedIconUri(theme, 'notifications/icon-info') } = props const opacity = useSharedValue(1) @@ -78,7 +79,7 @@ const NotificationCardComponent = (props: Props) => { - + {/* Android font scaling is too aggressive. @@ -95,7 +96,7 @@ const NotificationCardComponent = (props: Props) => { {onClose != null ? ( - + ) : null} diff --git a/src/components/notification/NotificationView.tsx b/src/components/notification/NotificationView.tsx index 1bcdc23644d..432974ab8b2 100644 --- a/src/components/notification/NotificationView.tsx +++ b/src/components/notification/NotificationView.tsx @@ -169,6 +169,7 @@ const NotificationViewComponent = (props: Props) => { persistent onPress={handleBackupPress} onClose={handleBackupClose} + testID="notifBackup" /> 0} enter={fadeIn} exit={fadeOut}> @@ -181,6 +182,7 @@ const NotificationViewComponent = (props: Props) => { message={lstrings.notif_otp_message} onPress={handleOtpReminderPress} onClose={handleOtpReminderClose} + testID="notifOtp" /> @@ -190,6 +192,7 @@ const NotificationViewComponent = (props: Props) => { message={lstrings.password_reminder_card_body} onPress={handlePasswordReminderPress} onClose={handlePasswordReminderClose} + testID="notifPassword" />