@@ -1152,9 +1152,10 @@ describe('Stringify Path', function () {
11521152
11531153 it ( 'object path' , function ( ) {
11541154 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' )
11581159 } )
11591160
11601161 it ( 'named route' , function ( ) {
@@ -1165,8 +1166,10 @@ describe('Stringify Path', function () {
11651166 }
11661167 } )
11671168 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' } } ) ) . toBe ( '/test/hi?b=%2Fc' )
11701173 } )
11711174
11721175 it ( 'named route not found should throw error' , function ( ) {
0 commit comments