@@ -22,6 +22,7 @@ interface Props {
22
22
* visible if the body is tapped. Default false. */
23
23
persistent ?: boolean
24
24
iconUri ?: string
25
+ testID ?: string
25
26
26
27
onPress : ( ) => void | Promise < void >
27
28
@@ -33,7 +34,7 @@ const NotificationCardComponent = (props: Props) => {
33
34
const theme = useTheme ( )
34
35
const styles = getStyles ( theme )
35
36
36
- const { title, type, message, persistent = false , onClose, onPress } = props
37
+ const { title, type, message, persistent = false , testID , onClose, onPress } = props
37
38
const { iconUri = type === 'warning' ? getThemedIconUri ( theme , 'notifications/icon-warning' ) : getThemedIconUri ( theme , 'notifications/icon-info' ) } = props
38
39
39
40
const opacity = useSharedValue ( 1 )
@@ -78,7 +79,7 @@ const NotificationCardComponent = (props: Props) => {
78
79
< ShadowedView style = { Platform . OS === 'android' ? styles . shadowAndroid : styles . shadowIos } >
79
80
< BlurBackground />
80
81
< Animated . View style = { [ styles . cardContainer , animatedStyle ] } >
81
- < TouchableContents onPress = { handlePress } >
82
+ < TouchableContents onPress = { handlePress } testID = { testID } >
82
83
< Icon source = { { uri : iconUri } } />
83
84
< TextView >
84
85
{ /* Android font scaling is too aggressive.
@@ -95,7 +96,7 @@ const NotificationCardComponent = (props: Props) => {
95
96
</ TextView >
96
97
</ TouchableContents >
97
98
{ onClose != null ? (
98
- < TouchableCloseButton onPress = { handleClose } >
99
+ < TouchableCloseButton onPress = { handleClose } testID = { ` ${ testID } .close` } >
99
100
< AntDesignIcon color = { theme . iconTappable } name = "close" size = { theme . rem ( 1.25 ) } />
100
101
</ TouchableCloseButton >
101
102
) : null }
0 commit comments