Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/components/Appbar/AppbarContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const AppbarContent = ({
titleMaxFontSizeMultiplier,
mode = 'small',
theme: themeOverrides,
testID = 'appbar-content',
testID,
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
Expand Down Expand Up @@ -135,7 +135,7 @@ const AppbarContent = ({
numberOfLines={1}
accessible
role={onPress ? 'none' : 'heading'}
testID={`${testID}-title-text`}
testID={testID ? `${testID}-title-text` : undefined}
maxFontSizeMultiplier={titleMaxFontSizeMultiplier}
>
{title}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Appbar/AppbarHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const AppbarHeader = ({
mode = Platform.OS === 'ios' ? 'center-aligned' : 'small',
elevated = false,
theme: themeOverrides,
testID = 'appbar-header',
testID,
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
Expand Down
4 changes: 2 additions & 2 deletions src/components/BottomNavigation/BottomNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ const BottomNavigation = <Route extends BaseRoute>({
safeAreaInsets,
labelMaxFontSizeMultiplier = 1,
compact: compactProp,
testID = 'bottom-navigation',
testID,
theme: themeOverrides,
getLazy = ({ route }: { route: Route }) => route.lazy,
}: Props<Route>) => {
Expand Down Expand Up @@ -579,7 +579,7 @@ const BottomNavigation = <Route extends BaseRoute>({
safeAreaInsets={safeAreaInsets}
labelMaxFontSizeMultiplier={labelMaxFontSizeMultiplier}
compact={compact}
testID={`${testID}-bar`}
testID={testID ? `${testID}-bar` : undefined}
theme={theme}
/>
</View>
Expand Down
6 changes: 3 additions & 3 deletions src/components/BottomNavigation/BottomNavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const BottomNavigationBar = <Route extends BaseRoute>({
safeAreaInsets,
labelMaxFontSizeMultiplier = 1,
compact: compactProp,
testID = 'bottom-navigation-bar',
testID,
theme: themeOverrides,
}: Props<Route>) => {
const theme = useInternalTheme(themeOverrides);
Expand Down Expand Up @@ -495,7 +495,7 @@ const BottomNavigationBar = <Route extends BaseRoute>({
>
<Animated.View
style={[styles.barContent, { backgroundColor }]}
testID={`${testID}-content`}
testID={testID ? `${testID}-content` : undefined}
>
<View
style={[
Expand All @@ -509,7 +509,7 @@ const BottomNavigationBar = <Route extends BaseRoute>({
},
]}
role={'tablist'}
testID={`${testID}-content-wrapper`}
testID={testID ? `${testID}-content-wrapper` : undefined}
>
{routes.map((route, index) => {
const focused = navigationState.index === index;
Expand Down
11 changes: 7 additions & 4 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const Button = ({
uppercase: uppercaseProp,
contentStyle,
labelStyle,
testID = 'button',
testID,
accessible,
background,
maxFontSizeMultiplier,
Expand Down Expand Up @@ -292,7 +292,7 @@ const Button = ({
<Surface
{...rest}
ref={ref}
testID={`${testID}-container`}
testID={testID ? `${testID}-container` : undefined}
backgroundColor={backgroundOpacity < 1 ? 'transparent' : backgroundColor}
{...touchableStyle}
style={[
Expand Down Expand Up @@ -342,7 +342,10 @@ const Button = ({
>
<View style={[styles.content, { opacity: textOpacity }, contentStyle]}>
{icon && loading !== true ? (
<View style={iconStyle} testID={`${testID}-icon-container`}>
<View
style={iconStyle}
testID={testID ? `${testID}-icon-container` : undefined}
>
<Icon
source={icon}
size={customLabelSize ?? iconSize}
Expand All @@ -369,7 +372,7 @@ const Button = ({
variant="labelLarge"
selectable={false}
numberOfLines={1}
testID={`${testID}-text`}
testID={testID ? `${testID}-text` : undefined}
style={[
styles.label,
isMode('text')
Expand Down
6 changes: 3 additions & 3 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const Card = ({
style,
contentStyle,
theme: themeOverrides,
testID = 'card',
testID,
accessible,
disabled,
ref,
Expand Down Expand Up @@ -225,13 +225,13 @@ const Card = ({
style={[{ borderColor }, style]}
theme={theme}
elevation={elevation}
testID={`${testID}-container`}
testID={testID ? `${testID}-container` : undefined}
{...rest}
>
{isMode('outlined') && (
<View
pointerEvents="none"
testID={`${testID}-outline`}
testID={testID ? `${testID}-outline` : undefined}
style={[
{
borderColor,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const Chip = ({
textStyle,
style,
theme: themeOverrides,
testID = 'chip',
testID,
selectedColor,
showSelectedCheck = true,
ellipsizeMode,
Expand Down Expand Up @@ -280,7 +280,7 @@ const Chip = ({
elevation={elevation}
transitionDuration={elevationTransitionDuration}
{...rest}
testID={`${testID}-container`}
testID={testID ? `${testID}-container` : undefined}
theme={theme}
>
<TouchableRipple
Expand Down
6 changes: 3 additions & 3 deletions src/components/CrossFadeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const CrossFadeIcon = ({
size,
source,
theme: themeOverrides,
testID = 'cross-fade-icon',
testID,
}: Props) => {
const theme = useInternalTheme(themeOverrides);

Expand Down Expand Up @@ -109,14 +109,14 @@ const CrossFadeIcon = ({
{hasPreviousIcon ? (
<Animated.View
style={[styles.icon, previousIconStyle]}
testID={`${testID}-previous`}
testID={testID ? `${testID}-previous` : undefined}
>
<Icon source={previousIcon} size={size} color={color} theme={theme} />
</Animated.View>
) : null}
<Animated.View
style={[styles.icon, currentIconStyle]}
testID={`${testID}-current`}
testID={testID ? `${testID}-current` : undefined}
>
<Icon source={currentIcon} size={size} color={color} theme={theme} />
</Animated.View>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Drawer/DrawerCollapsedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const DrawerCollapsedItem = ({
disabled,
'aria-label': ariaLabel,
badge = false,
testID = 'drawer-collapsed-item',
testID,
labelMaxFontSizeMultiplier,
...rest
}: Props) => {
Expand Down Expand Up @@ -195,12 +195,12 @@ const DrawerCollapsedItem = ({
style,
animatedOutlineStyle,
]}
testID={`${testID}-outline`}
testID={testID ? `${testID}-outline` : undefined}
/>

<View
style={[styles.icon, { top: iconPadding }]}
testID={`${testID}-container`}
testID={testID ? `${testID}-container` : undefined}
>
{badge !== false && (
<View style={styles.badgeContainer}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FAB/Extended.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const Extended = ({
labelMaxFontSizeMultiplier,
background,
style,
testID = 'extended-floating-action-button',
testID,
theme: themeOverrides,
ref,
}: Props) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FAB/FAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const FAB = ({
'aria-expanded': ariaExpanded,
background,
style,
testID = 'floating-action-button',
testID,
theme,
ref,
}: Props) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/FAB/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ const MorphingTrigger = ({
},
visible ? styles.pointerEventsBoxNone : styles.pointerEventsNone,
]}
testID={testID}
>
<Shell
size={size}
Expand All @@ -456,6 +455,7 @@ const MorphingTrigger = ({
visible={visible}
onPress={onPress}
aria-label={ariaLabel}
testID={testID}
widthShared={widthShared}
heightShared={heightShared}
borderRadiusShared={borderRadiusShared}
Expand Down Expand Up @@ -537,7 +537,7 @@ const Menu = ({
alignment = 'end',
closeIcon = 'close',
items,
testID = 'floating-action-button-menu',
testID,
theme: themeOverrides,
}: MenuProps) => {
const theme = useInternalTheme(themeOverrides);
Expand Down
4 changes: 2 additions & 2 deletions src/components/FAB/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const Shell = ({
overlay,
children,
style,
testID = 'fab-shell',
testID,
theme: themeOverrides,
ref,
}: ShellProps) => {
Expand Down Expand Up @@ -319,7 +319,7 @@ const Shell = ({
visible ? styles.pointerEventsAuto : styles.pointerEventsNone,
]}
elevation={elevation}
testID={`${testID}-container`}
testID={testID ? `${testID}-container` : undefined}
theme={theme}
>
<Animated.View style={[styles.clip, clipStyle]}>
Expand Down
11 changes: 8 additions & 3 deletions src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const IconButton = ({
mode,
style,
theme: themeOverrides,
testID = 'icon-button',
testID,
loading = false,
contentStyle,
ref,
Expand Down Expand Up @@ -157,7 +157,7 @@ const IconButton = ({
return (
<Animated.View
ref={ref}
testID={`${testID}-container`}
testID={testID ? `${testID}-container` : undefined}
style={[
styles.container,
{
Expand Down Expand Up @@ -199,7 +199,12 @@ const IconButton = ({
{loading ? (
<ActivityIndicator size={size} color={iconColor} />
) : (
<IconComponent color={iconColor} source={icon} size={size} />
<IconComponent
color={iconColor}
source={icon}
size={size}
testID={testID ? `${testID}-icon` : undefined}
/>
)}
</View>
</TouchableRipple>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const Menu = ({
visible,
statusBarHeight,
overlayAccessibilityLabel = 'Close menu',
testID = 'menu',
testID,
anchor,
onDismiss,
anchorPosition,
Expand Down Expand Up @@ -691,7 +691,7 @@ const Menu = ({
style={[styles.wrapper, positionStyle, style]}
pointerEvents={pointerEvents}
onAccessibilityEscape={onDismiss}
testID={`${testID}-view`}
testID={testID ? `${testID}-view` : undefined}
>
<Animated.View
pointerEvents={pointerEvents}
Expand All @@ -707,7 +707,7 @@ const Menu = ({
shadowMenuAnimationStyle,
]}
elevation={elevation}
testID={`${testID}-surface`}
testID={testID ? `${testID}-surface` : undefined}
theme={theme}
>
<Animated.View
Expand Down
4 changes: 2 additions & 2 deletions src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const MenuItem = ({
containerStyle,
contentStyle,
titleStyle,
testID = 'menu-item',
testID,
'aria-label': ariaLabel,
'aria-checked': ariaChecked,
'aria-selected': ariaSelected,
Expand Down Expand Up @@ -220,7 +220,7 @@ const MenuItem = ({
variant="bodyLarge"
selectable={false}
numberOfLines={1}
testID={`${testID}-title`}
testID={testID ? `${testID}-title` : undefined}
style={[titleTextStyle, titleStyle]}
maxFontSizeMultiplier={titleMaxFontSizeMultiplier}
>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function Modal({
contentElevation,
style,
theme: themeOverrides,
testID = 'modal',
testID,
}: Props) {
const theme = useInternalTheme(themeOverrides);

Expand Down Expand Up @@ -235,7 +235,7 @@ function Modal({
onPress={dismissable ? onDismissCallback : undefined}
importantForAccessibility="no"
style={[styles.backdrop, backdropStyle, backdropTransitionStyle]}
testID={`${testID}-backdrop`}
testID={testID ? `${testID}-backdrop` : undefined}
/>
<View
style={[
Expand All @@ -244,10 +244,10 @@ function Modal({
style,
]}
pointerEvents="box-none"
testID={`${testID}-wrapper`}
testID={testID ? `${testID}-wrapper` : undefined}
>
<Surface
testID={`${testID}-surface`}
testID={testID ? `${testID}-surface` : undefined}
theme={theme}
backgroundColor={contentBackgroundColor}
borderRadius={contentBorderRadius}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ProgressBar = ({
animatedValue,
style,
fillStyle,
testID = 'progress-bar',
testID,
...rest
}: Props) => {
const isWeb = Platform.OS === 'web';
Expand Down Expand Up @@ -213,7 +213,7 @@ const ProgressBar = ({
>
{width ? (
<Animated.View
testID={`${testID}-fill`}
testID={testID ? `${testID}-fill` : undefined}
style={[
styles.progressBar,
{
Expand Down
Loading