Skip to content

Commit 8052ea1

Browse files
committed
test(react-router): fix test for nested outlet rendering on direct navigation
1 parent 4fa0260 commit 8052ea1

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/react-router/test/base/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const App: React.FC = () => {
6767
<Route path="/replace-action" element={<Navigate to="/replace-action/page1" replace />} />
6868
<Route path="/tab-context/*" element={<TabsContext />} />
6969
<Route path="/outlet-ref" element={<OutletRef />} />
70-
<Route path="/swipe-to-go-back" element={<SwipeToGoBack />} />
70+
<Route path="/swipe-to-go-back/*" element={<SwipeToGoBack />} />
7171
<Route path="/dynamic-ionpage-classnames" element={<DynamicIonpageClassnames />} />
7272
<Route path="/tabs/*" element={<Tabs />} />
7373
<Route path="/tabs-secondary/*" element={<TabsSecondary />} />

packages/react-router/test/base/src/pages/swipe-to-go-back/SwipeToGoBack.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Details: React.FC = () => {
4141
<IonPage data-pageid="details">
4242
<IonHeader>
4343
<IonToolbar>
44-
<IonButtons>
44+
<IonButtons slot="start">
4545
<IonBackButton></IonBackButton>
4646
</IonButtons>
4747
<IonTitle>Details</IonTitle>

packages/react-router/test/base/tests/e2e/specs/swipe-to-go-back.cy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ describe('Swipe To Go Back', () => {
3131
cy.ionPageVisible('main');
3232
});
3333

34+
it('should render details page when navigating directly to nested route', () => {
35+
cy.visit(`http://localhost:${port}/swipe-to-go-back/details?${IOS_MODE}`);
36+
cy.ionPageVisible('details');
37+
38+
cy.get('[data-pageid="details"]').should('be.visible');
39+
cy.get('[data-pageid="details"] ion-content').should('contain', 'Details');
40+
});
41+
3442
it('should swipe and abort within a tab', () => {
3543
cy.visit(`http://localhost:${port}/tabs/tab1?${IOS_MODE}`);
3644
cy.ionPageVisible('tab1');

0 commit comments

Comments
 (0)