Skip to content

Commit 8b7699b

Browse files
authored
refactor(tests): reorganizing test-tabs-color-scheme and adding scenario (#3844)
## Description Reorganizing test-tabs-color-scheme and adding scenario Closes: software-mansion/react-native-screens-labs#1111 ## Changes - test-tabs-color-scheme moved to separate scenario-directory and rename to index.tsx file. - Manual scenario for this screen was also added to directory. - Small changes on screen - changing colors to make text be visible in light and dark mode. ## Before & after - visual documentation ### Before In dark mode text was not visible: <img width="1206" height="2622" alt="Simulator Screenshot - iPhone 17 Pro - 2026-04-07 at 15 39 09" src="https://github.com/user-attachments/assets/31f2f9ec-82ce-4a90-a492-689d0ba21ad5" /> ### After Color changes: <img width="1206" height="2622" alt="Simulator Screenshot - iPhone 17 Pro - 2026-04-07 at 15 38 34" src="https://github.com/user-attachments/assets/4172494b-28d6-4b9a-8bcf-32d5d89bb800" />
1 parent a8e7c7d commit 8b7699b

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

apps/src/tests/single-feature-tests/tabs/test-tabs-color-scheme.tsx renamed to apps/src/tests/single-feature-tests/tabs/test-tabs-color-scheme/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ function ConfigScreen() {
4141
return (
4242
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
4343
<View style={styles.section}>
44-
<Text>
44+
<Text style={styles.text}>
4545
There are 3 sources of color scheme, in ascending order of precedence:
4646
system, React Native and our property on TabsHost.
4747
</Text>
4848
</View>
4949

5050
<View style={styles.section}>
5151
<Text style={styles.heading}>System color scheme</Text>
52-
<Text>
52+
<Text style={styles.text}>
5353
Switch system color scheme via quick settings in notification drawer
5454
(Android/iOS) or Cmd+Shift+A (iOS simulator).
5555
</Text>
@@ -133,8 +133,12 @@ const styles = StyleSheet.create({
133133
fontSize: 24,
134134
fontWeight: 'bold',
135135
marginBottom: 5,
136+
color: 'rgb(0, 122, 255)',
136137
},
137138
section: {
138139
marginBottom: 10,
139140
},
141+
text: {
142+
color: 'gray'
143+
},
140144
});
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Test Scenario: colorScheme
2+
3+
**E2E test:** NO
4+
5+
## Prerequisites
6+
7+
- iOS device/simulator (use Cmd+Shift+A to toggle appearance on simulator)
8+
- Android emulator (use CLI):
9+
- `adb shell "cmd uimode night yes"`
10+
- `adb shell "cmd uimode night no"`
11+
12+
Assumption:
13+
14+
- System and RN color scheme settings are working correctly.
15+
- Here only the `colorScheme` prop on TabsHost is tested, verified against different system/RN combinations.
16+
17+
## Steps
18+
19+
### Baseline
20+
21+
1. Launch the app and navigate to the scenario
22+
23+
- [ ] Expected: Config tab is shown. Pickers default to `unspecified` / `inherit`
24+
25+
---
26+
27+
### TabsHost `inherit` — follows RN/system
28+
29+
2. Set system/RN to **light**, TabsHost colorScheme = `inherit`
30+
31+
- [ ] Expected: Tab bar appears **light**
32+
33+
3. Set system/RN to **dark**, keep TabsHost colorScheme = `inherit`
34+
35+
- [ ] Expected: Tab bar appears **dark** — TabsHost defers to RN/system
36+
37+
---
38+
39+
### TabsHost `light` — overrides RN/system
40+
41+
4. Set system/RN to **dark**, set TabsHost colorScheme = `light`
42+
43+
- [ ] Expected: Tab bar appears **light** — TabsHost overrides dark from RN/system
44+
45+
5. Set system/RN to **light**, keep TabsHost colorScheme = `light`
46+
47+
- [ ] Expected: Tab bar stays **light**
48+
49+
6. Cycle through `inherit``dark``light``dark``inherit`
50+
51+
- [ ] Expected: Tab bar color scheme updates immediately with each change, no crash or layout freeze
52+
53+
---
54+
55+
### TabsHost `dark` — overrides RN/system
56+
57+
7. Set system/RN to **light**, set TabsHost colorScheme = `dark`
58+
59+
- [ ] Expected: Tab bar appears **dark** — TabsHost overrides light from RN/system
60+
61+
8. Set system/RN to **dark**, keep TabsHost colorScheme = `dark`
62+
63+
- [ ] Expected: Tab bar stays **dark**
64+
65+
9. Cycle through `inherit``light``dark``light``inherit`
66+
67+
---
68+
69+
### Keyboard tab — simple check
70+
71+
10. Switch to the **Keyboard** tab, open the keyboard via TextInput (or Cmd+K on iOS simulator)
72+
73+
- [ ] Expected: Keyboard appearance matches the currently active color scheme — verify for both light and dark values.

0 commit comments

Comments
 (0)