chore(test): new screen and scenario for specialEffects: scrollToTop prop#3934
chore(test): new screen and scenario for specialEffects: scrollToTop prop#3934
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new manual test scenario and corresponding test screen to validate specialEffects.repeatedTabSelection.scrollToTop behavior on tab routes, including repeated-tap vs switching-tabs behavior.
Changes:
- Added a new tabs test screen with 3 tabs covering
scrollToTop: true,false, and default (unset). - Added a manual test scenario describing expected scroll-to-top behavior for each tab configuration.
- Registered the new scenario in the Tabs single-feature-tests group.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/scenario.md | New manual scenario for repeated-tab selection scroll-to-top behavior. |
| apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx | New test screen implementing 3-tab configuration for the scenario. |
| apps/src/tests/single-feature-tests/tabs/index.ts | Registers the new scenario so it’s reachable from the navigator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| **Description:** This test scenario validates the `specialEffects.repeatedTabSelection. | ||
| scrollToTop` property on tab routes. It verifies that re-tapping an already-active |
There was a problem hiding this comment.
The inline code span for the tested property is broken across a newline (specialEffects.repeatedTabSelection. scrollToTop), which renders awkwardly in Markdown. Keep the property path within a single code span for readability.
| tab scrolls a scrollable screen back to the top when the property is enabled, and | ||
| that there is no scroll-to-top behavior when it is disabled or absent. | ||
|
|
||
| **OS test creation version:** iOS: 18.4 and 26.2 Android: 16.0 (Baklava). |
There was a problem hiding this comment.
OS test creation version line is missing a comma separator between iOS and Android ("... 26.2 Android ..."). This looks like a typo; align with the existing format used in other scenarios (e.g., "iOS: …, Android: …").
| **OS test creation version:** iOS: 18.4 and 26.2 Android: 16.0 (Baklava). | |
| **OS test creation version:** iOS: 18.4 and 26.2, Android: 16.0 (Baklava). |
kligarski
left a comment
There was a problem hiding this comment.
Looks good but I have some comments.
It would also be nice to have some videos with the test in PR description.
…ects/index.tsx Co-authored-by: Krzysztof Ligarski <63918941+kligarski@users.noreply.github.com>
…ware-mansion/react-native-screens into @lkuchno/test-tabs-switching_screen
…ns into @lkuchno/test-tabs-switching_screen
| platforms: ['ios', 'android'], | ||
| }; | ||
|
|
||
| function ScrollScreen() { |
Description
Adds a test scenario for the specialEffects.repeatedTabSelection.scrollToTop property on tab routes. The scenario uses three tabs with a scrollable list each, covering all meaningful states of the property: explicitly enabled, explicitly disabled, and absent (default platform behavior).
The scenario also validates that scrollToTop only triggers on a repeated tap of the already-active tab - switching away and back must preserve scroll position.
Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1154
Changes
test-tabs-special-effects/index.tsx
New test screen component with three tabs sharing a single ScrollScreen component.
test-tabs-special-effects/scenario.md
Manual test scenario with four sections: scrollToTop: true, scrollToTop: false, no specialEffects (default), and a switching-away-and-back case that verifies scroll position is preserved on non-repeated tab navigation.
single-feature-tests/tabs/index.ts
Registered TestTabsSpecialEffects in the tabs scenario group so the screen is reachable from the test navigator.
Test demo
Screen.Recording.2026-04-28.at.16.23.33.mov