@@ -103,6 +103,9 @@ describe('localePath', () => {
103
103
assert . equal ( vm . localePath ( { path : '/' , query : { foo : 1 } } ) , '/ja?foo=1' )
104
104
assert . equal ( vm . localePath ( { name : 'about' , query : { foo : 1 } } ) , '/ja/about?foo=1' )
105
105
assert . equal ( vm . localePath ( { path : '/about' , query : { foo : 1 } } ) , '/ja/about?foo=1' )
106
+ assert . equal ( vm . localePath ( '/?foo=1' ) , '/ja?foo=1' )
107
+ assert . equal ( vm . localePath ( '/about?foo=1' ) , '/ja/about?foo=1' )
108
+ assert . equal ( vm . localePath ( '/about?foo=1&test=2' ) , '/ja/about?foo=1&test=2' )
106
109
107
110
// no define path
108
111
assert . equal ( vm . localePath ( '/vue-i18n' ) , '/ja/vue-i18n' )
@@ -420,6 +423,11 @@ describe('switchLocalePath', () => {
420
423
assert . equal ( vm . switchLocalePath ( 'fr' ) , '/fr/about' )
421
424
assert . equal ( vm . switchLocalePath ( 'vue-i18n' ) , '' )
422
425
426
+ await router . push ( '/ja/about?foo=1&test=2' )
427
+ assert . equal ( vm . switchLocalePath ( 'ja' ) , '/ja/about?foo=1&test=2' )
428
+ assert . equal ( vm . switchLocalePath ( 'fr' ) , '/fr/about?foo=1&test=2' )
429
+ assert . equal ( vm . switchLocalePath ( 'en' ) , '/en/about?foo=1&test=2' )
430
+
423
431
await router . push ( '/ja/category/1' )
424
432
assert . equal ( vm . switchLocalePath ( 'ja' ) , '/ja/category/japanese' )
425
433
assert . equal ( vm . switchLocalePath ( 'en' ) , '/en/category/english' )
0 commit comments