Skip to content

refactor(test): add scenario for test-stack-simple-nav#4270

Merged
LKuchno merged 10 commits into
mainfrom
@lkuchno/test-stack-simple-nav
Jul 16, 2026
Merged

refactor(test): add scenario for test-stack-simple-nav#4270
LKuchno merged 10 commits into
mainfrom
@lkuchno/test-stack-simple-nav

Conversation

@LKuchno

@LKuchno LKuchno commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1601

This PR adds a comprehensive manual test scenario for the gamma/v5 StackContainer's simple push/pop navigation, and adjusts the test-stack-simple-nav screen so the scenario can be exercised on both platforms.

The scenario documents the full lifecycle from root (Home) through stacking/unstacking screens A and B, covering:

  • push/pop via the on-screen buttons,
  • the native header back button,
  • the iOS edge-swipe-back / Android system gesture-back.

It validates that each push creates a new instance with a unique routeKey, that a preserved (not recreated) screen keeps its routeKey on pop, and that the root screen (Home) cannot be popped. Edge cases (re-pushing an already-present route, rapid tapping push/pop, route-key uniqueness) are included.

The scenario also documents the platform launch difference: iOS runs from the in-app scenario menu, while Android must be launched directly via apps/App.tsx (rendering TestStackSimpleNav as the root). This is the current workaround for the Android back-button limitation (issue #1459), where the native back button and system gesture-back only pop the stack when the StackContainer is at the root rather than nested inside the example app's navigation.

Changes

  • Test screen (index.tsx): Added headerConfig with a title to the Home, A, and B routes. Rendering a header makes the native back button appear on non-root screens (including on Android), which is required to test the header-back-button and gesture-back flows.
  • Scenario metadata (scenario-description.ts): Renamed the scenario from "Simple navigation scenario" to "Simple stack navigation".
  • Scenario (scenario.md): Added the manual scenario documenting all push/pop flows, native header-back-button and edge-swipe / system gesture-back interactions, routeKey behavior, per-platform launch instructions, and edge cases (re-pushing the same route, rapid tapping, root-screen protection). E2E automation is noted as TBD.

@LKuchno LKuchno added the area:stack-v5 Issues related to Native Stack v5 implementation label Jul 6, 2026
@LKuchno LKuchno changed the title chore(test): add scenario for Stack v5 simple navigation refactor(test): add scenario for test-stack-simple-nav Jul 6, 2026
@LKuchno
LKuchno requested a review from Copilot July 6, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a manual test scenario document for the Stack v5 “simple navigation” screen in the example app, describing expected push/pop behavior and platform-specific back navigation interactions.

Changes:

  • Added a new scenario.md documenting push/pop flows across Home/A/B, including re-push behavior and routeKey expectations.
  • Documented iOS-native back interactions (header back + edge-swipe) and Android limitations, plus E2E automation notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/src/tests/single-feature-tests/stack-v5/test-stack-simple-nav/scenario.md Outdated
Comment thread apps/src/tests/single-feature-tests/stack-v5/test-stack-simple-nav/scenario.md Outdated
Comment thread apps/src/tests/single-feature-tests/stack-v5/test-stack-simple-nav/scenario.md Outdated
@LKuchno
LKuchno requested a review from kkafar July 6, 2026 14:09
@LKuchno
LKuchno marked this pull request as draft July 7, 2026 08:57

@kkafar kkafar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I'm against naming such details as background colours in the scenario description. It can very easily go out of date.

This is a minor however. I recommend to think about it.

@LKuchno
LKuchno merged commit e60aa86 into main Jul 16, 2026
3 checks passed
@LKuchno
LKuchno deleted the @lkuchno/test-stack-simple-nav branch July 16, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:stack-v5 Issues related to Native Stack v5 implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants