@@ -1152,9 +1152,10 @@ describe('Stringify Path', function () {
1152
1152
1153
1153
it ( 'object path' , function ( ) {
1154
1154
expect ( router . stringifyPath ( { path : '/hi' } ) ) . toBe ( '/hi' )
1155
- expect ( router . stringifyPath ( { path : '/hi' , query : { a : 1 } } ) ) . toBe ( '/hi?a=1' )
1156
- expect ( router . stringifyPath ( { path : '/hi' , query : { a : 1 , b : 2 } } ) ) . toBe ( '/hi?a=1&b=2' )
1157
- expect ( router . stringifyPath ( { path : '/hi?c=3' , query : { a : 1 , b : 2 } } ) ) . toBe ( '/hi?c=3&a=1&b=2' )
1155
+ expect ( router . stringifyPath ( { path : '/hi' , query : { a : 1 } } ) ) . toBe ( '/hi?a=1' )
1156
+ expect ( router . stringifyPath ( { path : '/hi' , query : { a : 1 , b : 2 } } ) ) . toBe ( '/hi?a=1&b=2' )
1157
+ expect ( router . stringifyPath ( { path : '/hi?c=3' , query : { a : 1 , b : 2 } } ) ) . toBe ( '/hi?c=3&a=1&b=2' )
1158
+ expect ( router . stringifyPath ( { path : '/hi' , query : { a : '/c' } } ) ) . toBe ( '/hi?a=%2Fc' )
1158
1159
} )
1159
1160
1160
1161
it ( 'named route' , function ( ) {
@@ -1165,8 +1166,10 @@ describe('Stringify Path', function () {
1165
1166
}
1166
1167
} )
1167
1168
expect ( router . stringifyPath ( { name : 'a' } ) ) . toBe ( '/test/:id' )
1168
- expect ( router . stringifyPath ( { name : 'a' , params : { id : 0 } } ) ) . toBe ( '/test/0' )
1169
- expect ( router . stringifyPath ( { name : 'a' , params : { id : 'hi' } } ) ) . toBe ( '/test/hi' )
1169
+ expect ( router . stringifyPath ( { name : 'a' , params : { id : 0 } } ) ) . toBe ( '/test/0' )
1170
+ expect ( router . stringifyPath ( { name : 'a' , params : { id : 'hi' } } ) ) . toBe ( '/test/hi' )
1171
+ expect ( router . stringifyPath ( { name : 'a' , params : { id : '你好' } } ) ) . toBe ( '/test/' + encodeURIComponent ( '你好' ) )
1172
+ expect ( router . stringifyPath ( { name : 'a' , params : { id : 'hi' } , query : { b : '/c' } } ) <
4830
span class=pl-kos>). toBe ( '/test/hi?b=%2Fc' )
1170
1173
} )
1171
1174
1172
1175
it ( 'named route not found should throw error' , function ( ) {
0 commit comments