File tree Expand file tree Collapse file tree 2 files changed +1
-39
lines changed
packages/react-router/test/base Expand file tree Collapse file tree 2 files changed +1
-39
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,6 @@ const RelativePathsHome: React.FC = () => {
4343 < IonItem routerLink = "/relative-paths/page-b" >
4444 < IonLabel > Go to Page B (relative path route)</ IonLabel >
4545 </ IonItem >
46- < IonItem routerLink = "/relative-paths/page-c" >
47- < IonLabel > Go to Page C (relative path route)</ IonLabel >
48- </ IonItem >
4946 </ IonList >
5047 </ IonContent >
5148 </ IonPage >
@@ -92,35 +89,14 @@ const PageB: React.FC = () => {
9289 ) ;
9390} ;
9491
95- const PageC : React . FC = ( ) => {
96- return (
97- < IonPage data-pageid = "relative-paths-page-c" >
98- < IonHeader >
99- < IonToolbar >
100- < IonButtons slot = "start" >
101- < IonBackButton defaultHref = "/relative-paths" />
102- </ IonButtons >
103- < IonTitle > Page C</ IonTitle >
104- </ IonToolbar >
105- </ IonHeader >
106- < IonContent >
107- < div data-testid = "page-c-content" >
108- This is Page C - another route defined with relative path
109- </ div >
110- </ IonContent >
111- </ IonPage >
112- ) ;
113- } ;
114-
11592const RelativePaths : React . FC = ( ) => {
11693 return (
11794 < IonRouterOutlet >
11895 { /* Route with absolute path (has leading slash) - this should work */ }
11996 < Route path = "/relative-paths/page-a" element = { < PageA /> } />
12097
121- { /* Routes with relative paths (no leading slash) */ }
98+ { /* Route with relative path (no leading slash) */ }
12299 < Route path = "page-b" element = { < PageB /> } />
123- < Route path = "page-c" element = { < PageC /> } />
124100
125101 { /* Home route - using relative path */ }
126102 < Route path = "" element = { < RelativePathsHome /> } />
Original file line number Diff line number Diff line change @@ -27,26 +27,12 @@ describe('Relative Paths Tests', () => {
2727 cy . get ( '[data-testid="page-b-content"]' ) . should ( 'contain' , 'Page B' ) ;
2828 } ) ;
2929
30- it ( 'should navigate to Page C (defined with relative path - no leading slash)' , ( ) => {
31- cy . visit ( `http://localhost:${ port } /relative-paths` ) ;
32- cy . ionPageVisible ( 'relative-paths-home' ) ;
33- cy . ionNav ( 'ion-item' , 'Go to Page C' ) ;
34- cy . ionPageVisible ( 'relative-paths-page-c' ) ;
35- cy . get ( '[data-testid="page-c-content"]' ) . should ( 'contain' , 'Page C' ) ;
36- } ) ;
37-
3830 it ( 'should navigate directly to Page B via URL' , ( ) => {
3931 cy . visit ( `http://localhost:${ port } /relative-paths/page-b` ) ;
4032 cy . ionPageVisible ( 'relative-paths-page-b' ) ;
4133 cy . get ( '[data-testid="page-b-content"]' ) . should ( 'contain' , 'Page B' ) ;
4234 } ) ;
4335
44- it ( 'should navigate directly to Page C via URL' , ( ) => {
45- cy . visit ( `http://localhost:${ port } /relative-paths/page-c` ) ;
46- cy . ionPageVisible ( 'relative-paths-page-c' ) ;
47- cy . get ( '[data-testid="page-c-content"]' ) . should ( 'contain' , 'Page C' ) ;
48- } ) ;
49-
5036 it ( 'should navigate to Page B and back' , ( ) => {
5137 cy . visit ( `http://localhost:${ port } /relative-paths` ) ;
5238 cy . ionPageVisible ( 'relative-paths-home' ) ;
You can’t perform that action at this time.
0 commit comments