Skip to content

Commit bcc91c3

Browse files
committed
Add Maestro testID support in NotificationCard
1 parent 49fb15a commit bcc91c3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- added: Add PIVX.
66
- added: Monero multi output support.
77
- added: Moonpay Sell support for ACH.
8+
- added: Maestro `testID` support in `NotificationCard`
89
- fixed: `SceneWrapper` bottom inset calculations for scenes that do not `avoidKeyboard`
910

1011
## 4.26.0 (2025-04-14)

src/components/notification/NotificationCard.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface Props {
2222
* visible if the body is tapped. Default false. */
2323
persistent?: boolean
2424
iconUri?: string
25+
testID?: string
2526

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

@@ -33,7 +34,7 @@ const NotificationCardComponent = (props: Props) => {
3334
const theme = useTheme()
3435
const styles = getStyles(theme)
3536

36-
const { title, type, message, persistent = false, onClose, onPress } = props
37+
const { title, type, message, persistent = false, testID, onClose, onPress } = props
3738
const { iconUri = type === 'warning' ? getThemedIconUri(theme, 'notifications/icon-warning') : getThemedIconUri(theme, 'notifications/icon-info') } = props
3839

3940
const opacity = useSharedValue(1)
@@ -78,7 +79,7 @@ const NotificationCardComponent = (props: Props) => {
7879
<ShadowedView style={Platform.OS === 'android' ? styles.shadowAndroid : styles.shadowIos}>
7980
<BlurBackground />
8081
<Animated.View style={[styles.cardContainer, animatedStyle]}>
81-
<TouchableContents onPress={handlePress}>
82+
<TouchableContents onPress={handlePress} testID={testID}>
8283
<Icon source={{ uri: iconUri }} />
8384
<TextView>
8485
{/* Android font scaling is too aggressive.
@@ -95,7 +96,7 @@ const NotificationCardComponent = (props: Props) => {
9596
</TextView>
9697
</TouchableContents>
9798
{onClose != null ? (
98-
<TouchableCloseButton onPress={handleClose}>
99+
<TouchableCloseButton onPress={handleClose} testID={`${testID}.close`}>
99100
<AntDesignIcon color={theme.iconTappable} name="close" size={theme.rem(1.25)} />
100101
</TouchableCloseButton>
101102
) : null}

src/components/notification/NotificationView.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ const NotificationViewComponent = (props: Props) => {
169169
persistent
170170
onPress={handleBackupPress}
171171
onClose={handleBackupClose}
172+
testID="notifBackup"
172173
/>
173174
</EdgeAnim>
174175
<EdgeAnim visible={autoDetectTokenCards.length > 0} enter={fadeIn} exit={fadeOut}>
@@ -181,6 +182,7 @@ const NotificationViewComponent = (props: Props) => {
181182
message={lstrings.notif_otp_message}
182183
onPress={handleOtpReminderPress}
183184
onClose={handleOtpReminderClose}
185+
testID="notifOtp"
184186
/>
185187
</EdgeAnim>
186188
<EdgeAnim visible={!pwReminder.isBannerHidden} enter={fadeIn} exit={fadeOut}>
@@ -190,6 +192,7 @@ const NotificationViewComponent = (props: Props) => {
190192
message={lstrings.password_reminder_card_body}
191193
onPress={handlePasswordReminderPress}
192194
onClose={handlePasswordReminderClose}
195+
testID="notifPassword"
193196
/>
194197
</EdgeAnim>
195198
<EdgeAnim visible={!ip2FaReminder.isBannerHidden} enter={fadeIn} exit={fadeOut}>

0 commit comments

Comments
 (0)