File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,19 @@ describe('react-router-component (on server)', function() {
90
90
handler : function ( props ) {
91
91
return Router . Link ( { global : true , href : '/hi' } ) ;
92
92
}
93
+ } ) ,
94
+ Router . Location ( {
95
+ path : '/hello3/*' ,
96
+ handler : function ( props ) {
97
+ return Router . Locations ( { className : 'Y' , contextual : true } ,
98
+ Router . Location ( {
99
+ path : '/:subslug' ,
100
+ handler : function ( props ) {
101
+ return Router . Link ( { href : '/sup-' + props . subslug } ) ;
102
+ }
103
+ } )
104
+ ) ;
105
+ }
93
106
} )
94
107
)
95
108
}
@@ -121,6 +134,14 @@ describe('react-router-component (on server)', function() {
121
134
assert ( markup . match ( / h r e f = " \/ h i " / ) ) ;
122
135
} ) ;
123
136
137
+ it ( 'renders Link component with href scoped to its nested context prefix' , function ( ) {
138
+ var markup = React . renderComponentToString ( App ( { path : '/x/nice/hello3/welcome' } ) ) ;
139
+ assert ( markup . match ( / c l a s s = " A p p " / ) ) ;
140
+ assert ( markup . match ( / c l a s s = " X " / ) ) ;
141
+ assert ( markup . match ( / c l a s s = " Y " / ) ) ;
142
+ assert ( markup . match ( / h r e f = " \/ x \/ n i c e \/ h e l l o 3 \/ s u p - w e l c o m e " / ) ) ;
143
+ } ) ;
144
+
124
145
} ) ;
125
146
126
147
You can’t perform that action at this time.
0 commit comments