Skip to content

Add Maestro testID support in NotificationCard #5547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions src/components/notification/NotificationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface Props {
* visible if the body is tapped. Default false. */
persistent?: boolean
iconUri?: string
testID?: string

onPress: () => void | Promise<void>

Expand All @@ -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)
Expand Down Expand Up @@ -78,7 +79,7 @@ const NotificationCardComponent = (props: Props) => {
<ShadowedView style={Platform.OS === 'android' ? styles.shadowAndroid : styles.shadowIos}>
<BlurBackground />
<Animated.View style={[styles.cardContainer, animatedStyle]}>
<TouchableContents onPress={handlePress}>
<TouchableContents onPress={handlePress} testID={testID}>
<Icon source={{ uri: iconUri }} />
<TextView>
{/* Android font scaling is too aggressive.
Expand All @@ -95,7 +96,7 @@ const NotificationCardComponent = (props: Props) => {
</TextView>
</TouchableContents>
{onClose != null ? (
<TouchableCloseButton onPress={handleClose}>
<TouchableCloseButton onPress={handleClose} testID={`${testID}.close`}>
<AntDesignIcon color={theme.iconTappable} name="close" size={theme.rem(1.25)} />
</TouchableCloseButton>
) : null}
Expand Down
3 changes: 3 additions & 0 deletions src/components/notification/NotificationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ const NotificationViewComponent = (props: Props) => {
persistent
onPress={handleBackupPress}
onClose={handleBackupClose}
testID="notifBackup"
/>
</EdgeAnim>
<EdgeAnim visible={autoDetectTokenCards.length > 0} enter={fadeIn} exit={fadeOut}>
Expand All @@ -181,6 +182,7 @@ const NotificationViewComponent = (props: Props) => {
message={lstrings.notif_otp_message}
onPress={handleOtpReminderPress}
onClose={handleOtpReminderClose}
testID="notifOtp"
/>
</EdgeAnim>
<EdgeAnim visible={!pwReminder.isBannerHidden} enter={fadeIn} exit={fadeOut}>
Expand All @@ -190,6 +192,7 @@ const NotificationViewComponent = (props: Props) => {
message={lstrings.password_reminder_card_body}
onPress={handlePasswordReminderPress}
onClose={handlePasswordReminderClose}
testID="notifPassword"
/>
</EdgeAnim>
<EdgeAnim visible={!ip2FaReminder.isBannerHidden} enter={fadeIn} exit={fadeOut}>
Expand Down
Loading