11import * as React from 'react' ;
2- import { Image , ImageSourcePropType , View , ViewProps } from 'react-native' ;
2+ import { Image , ImageSourcePropType , View } from 'react-native' ;
33import { DeepPartial } from 'ts-essentials' ;
44
55import { Theme , withTheme } from '../../theme' ;
@@ -26,7 +26,7 @@ export const globalGetInitials: GetInitialsType = (name, fallback = '?') => {
2626 . join ( '' ) ;
2727} ;
2828
29- export interface AvatarProps extends ViewProps {
29+ export interface AvatarProps {
3030 /**
3131 * The source attribute of the image.
3232 * When it's not available, render initials instead.
@@ -83,6 +83,8 @@ export interface AvatarProps extends ViewProps {
8383 theme : Theme ;
8484
8585 getStyles ?: ReplaceReturnType < GetAvatarStyles , DeepPartial < AvatarStyles > > ;
86+
87+ testID ?: string ;
8688}
8789
8890export const AvatarBase = ( props : AvatarProps ) => {
@@ -99,7 +101,7 @@ export const AvatarBase = (props: AvatarProps) => {
99101 forceShowInitials = false ,
100102 sizeLimitOneCharacter = 20 ,
101103 getStyles,
102- ... viewProps
104+ testID ,
103105 } = props ;
104106
105107 const { imageHasFailedLoading } = { imageHasFailedLoading : false } ;
@@ -126,7 +128,7 @@ export const AvatarBase = (props: AvatarProps) => {
126128 ) ;
127129
128130 return (
129- < View style = { boxStyle } { ... viewProps } >
131+ < View style = { boxStyle } testID = { testID } >
130132 { ( imageUnavailable || forceShowInitials ) && (
131133 < Text
132134 getStyles = { ( ) => ( {
0 commit comments