Skip to content

Commit fe47106

Browse files
committed
Rename prop names
1 parent 88ef668 commit fe47106

File tree

13 files changed

+33
-37
lines changed

13 files changed

+33
-37
lines changed

android/src/main/java/com/swmansion/rnscreens/gamma/tabs/TabScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class TabScreen(
5858
}
5959

6060
// Accessibility
61-
var tabBarItemTestId: String? by Delegates.observable(null) { _, oldValue, newValue ->
61+
var tabBarItemTestID: String? by Delegates.observable(null) { _, oldValue, newValue ->
6262
updateMenuItemAttributesIfNeeded(oldValue, newValue)
6363
}
6464

android/src/main/java/com/swmansion/rnscreens/gamma/tabs/TabScreenViewManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ class TabScreenViewManager :
181181
value: String?,
182182
) = Unit
183183

184-
@ReactProp(name = "tabBarItemTestId")
185-
override fun setTabBarItemTestId(
184+
@ReactProp(name = "tabBarItemTestID")
185+
override fun setTabBarItemTestID(
186186
view: TabScreen,
187187
value: String?,
188188
) {
189-
view.tabBarItemTestId = value
189+
view.tabBarItemTestID = value
190190
}
191191

192192
@ReactProp(name = "tabBarItemAccessibilityLabel")

android/src/main/java/com/swmansion/rnscreens/gamma/tabs/TabsHostA11yCoordinator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TabsHostA11yCoordinator(
2020
}
2121

2222
// when matching view by id, espresso driver seems to look for tag property
23-
menuView.tag = tabScreen.tabBarItemTestId
23+
menuView.tag = tabScreen.tabBarItemTestID
2424
}
2525

2626
fun setA11yPropertiesToTabItems() {

android/src/paper/java/com/facebook/react/viewmanagers/RNSBottomTabsScreenManagerDelegate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public void setProperty(T view, String propName, @Nullable Object value) {
4141
case "badgeValue":
4242
mViewManager.setBadgeValue(view, value == null ? null : (String) value);
4343
break;
44-
case "tabBarItemTestId":
45-
mViewManager.setTabBarItemTestId(view, value == null ? null : (String) value);
44+
case "tabBarItemTestID":
45+
mViewManager.setTabBarItemTestID(view, value == null ? null : (String) value);
4646
break;
4747
case "tabBarItemAccessibilityLabel":
4848
mViewManager.setTabBarItemAccessibilityLabel(view, value == null ? null : (String) value);

android/src/paper/java/com/facebook/react/viewmanagers/RNSBottomTabsScreenManagerInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface RNSBottomTabsScreenManagerInterface<T extends View> extends Vie
2121
void setTitle(T view, @Nullable String value);
2222
void setIsTitleUndefined(T view, boolean value);
2323
void setBadgeValue(T view, @Nullable String value);
24-
void setTabBarItemTestId(T view, @Nullable String value);
24+
void setTabBarItemTestID(T view, @Nullable String value);
2525
void setTabBarItemAccessibilityLabel(T view, @Nullable String value);
2626
void setOrientation(T view, @Nullable String value);
2727
void setDrawableIconResourceName(T view, @Nullable String value);

apps/src/tests/TestBottomTabs/index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const TAB_CONFIGS: TabConfiguration[] = [
3131
},
3232
},
3333
},
34-
screenTestId: 'tab-screen-1-id',
35-
tabBarItemTestId: 'tab-item-1-id',
36-
screenAccessibilityLabel: 'First Tab Screen',
34+
testID: 'tab-screen-1-id',
35+
accessibilityLabel: 'First Tab Screen',
36+
tabBarItemTestID: 'tab-item-1-id',
3737
tabBarItemAccessibilityLabel: 'First Tab Item',
3838
tabKey: 'Tab1',
3939
title: 'Tab1',
@@ -59,9 +59,9 @@ const TAB_CONFIGS: TabConfiguration[] = [
5959
tabScreenProps: {
6060
tabKey: 'Tab2',
6161
badgeValue: 'NEW',
62-
screenTestId: 'tab-screen-2-id',
63-
tabBarItemTestId: 'tab-item-2-id',
64-
screenAccessibilityLabel: 'Second Tab Screen',
62+
testID: 'tab-screen-2-id',
63+
accessibilityLabel: 'Second Tab Screen',
64+
tabBarItemTestID: 'tab-item-2-id',
6565
tabBarItemAccessibilityLabel: 'Second Tab Item',
6666
scrollEdgeAppearance: {
6767
tabBarBackgroundColor: Colors.NavyDark140,
@@ -137,9 +137,9 @@ const TAB_CONFIGS: TabConfiguration[] = [
137137
tabScreenProps: {
138138
tabKey: 'Tab3',
139139
badgeValue: '2137',
140-
screenTestId: 'tab-screen-3-id',
141-
tabBarItemTestId: 'tab-item-3-id',
142-
screenAccessibilityLabel: 'Third Tab Screen',
140+
testID: 'tab-screen-3-id',
141+
accessibilityLabel: 'Third Tab Screen',
142+
tabBarItemTestID: 'tab-item-3-id',
143143
tabBarItemAccessibilityLabel: 'Third Tab Item',
144144
scrollEdgeEffects: { bottom: 'hard' },
145145
tabBarItemBadgeBackgroundColor: Colors.RedDark40,
@@ -176,9 +176,9 @@ const TAB_CONFIGS: TabConfiguration[] = [
176176
{
177177
tabScreenProps: {
178178
tabKey: 'Tab4',
179-
screenTestId: 'tab-screen-4-id',
180-
tabBarItemTestId: 'tab-item-4-id',
181-
screenAccessibilityLabel: 'Fourth Tab Screen',
179+
testID: 'tab-screen-4-id',
180+
accessibilityLabel: 'Fourth Tab Screen',
181+
tabBarItemTestID: 'tab-item-4-id',
182182
tabBarItemAccessibilityLabel: 'Fourth Tab Item',
183183
icon: {
184184
ios: {

ios/bottom-tabs/screen/RNSBottomTabsScreenComponentView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN
6464
@property (nonatomic, nullable) NSString *tabKey;
6565
@property (nonatomic, nullable) NSString *badgeValue;
6666

67-
@property (nonatomic, nullable) NSString *tabBarItemTestId;
67+
@property (nonatomic, nullable) NSString *tabBarItemTestID;
6868
@property (nonatomic, nullable) NSString *tabBarItemAccessibilityLabel;
6969

7070
@property (nonatomic, readonly) RNSBottomTabsIconType iconType;

ios/bottom-tabs/screen/RNSBottomTabsScreenComponentView.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ - (void)updateProps:(const facebook::react::Props::Shared &)props
294294
tabBarItemNeedsUpdate = YES;
295295
}
296296

297-
if (newComponentProps.tabBarItemTestId != oldComponentProps.tabBarItemTestId) {
298-
_tabBarItemTestId = RCTNSStringFromStringNilIfEmpty(newComponentProps.tabBarItemTestId);
297+
if (newComponentProps.tabBarItemTestID != oldComponentProps.tabBarItemTestID) {
298+
_tabBarItemTestID = RCTNSStringFromStringNilIfEmpty(newComponentProps.tabBarItemTestID);
299299
tabBarItemNeedsRecreation = YES;
300300
}
301301

@@ -351,8 +351,8 @@ - (void)updateProps:(const facebook::react::Props::Shared &)props
351351
tabItemNeedsAppearanceUpdate = YES;
352352
}
353353

354-
if (newComponentProps.tabBarItemTestId != oldComponentProps.tabBarItemTestId) {
355-
_controller.tabItemTestId = RCTNSStringFromStringNilIfEmpty(newComponentProps.tabBarItemTestId);
354+
if (newComponentProps.tabBarItemTestID != oldComponentProps.tabBarItemTestID) {
355+
_controller.tabItemTestID = RCTNSStringFromStringNilIfEmpty(newComponentProps.tabBarItemTestID);
356356
tabBarItemNeedsA11yUpdate = YES;
357357
}
358358

ios/bottom-tabs/screen/RNSTabsScreenViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
1717

1818
@property (nonatomic, strong, readonly, nullable) RNSBottomTabsScreenComponentView *tabScreenComponentView;
1919
@property (nonatomic, weak, readonly, nullable) id<RNSBottomTabsSpecialEffectsSupporting> tabsSpecialEffectsDelegate;
20-
@property (nonatomic, nullable) NSString *tabItemTestId;
20+
@property (nonatomic, nullable) NSString *tabItemTestID;
2121
@property (nonatomic, nullable) NSString *tabItemAccessibilityLabel;
2222

2323
/**

ios/bottom-tabs/screen/RNSTabsScreenViewController.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ - (RNSOrientation)evaluateOrientation
132132

133133
- (void)updateTabItemA11yProps
134134
{
135-
self.tabBarItem.accessibilityIdentifier = _tabItemTestId;
135+
self.tabBarItem.accessibilityIdentifier = _tabItemTestID;
136136
self.tabBarItem.accessibilityLabel = _tabItemAccessibilityLabel;
137137
}
138138

0 commit comments

Comments
 (0)