]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: add more relative path
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 28 Nov 2022 09:47:12 +0000 (10:47 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 28 Nov 2022 09:47:12 +0000 (10:47 +0100)
packages/router/__tests__/location.spec.ts
packages/router/__tests__/router.spec.ts

index 076faa1b086a12173d33d37479458a6a8cbab7be..08e111bff2fcf024e88d51cd069fbe4d9cc84744 100644 (file)
@@ -359,6 +359,7 @@ describe('resolveRelativePath', () => {
   })
 
   it('works without anything after the ..', () => {
+    expect(resolveRelativePath('../', '/users/posva')).toBe('/')
     expect(resolveRelativePath('../', '/users/posva/new')).toBe('/users/')
     expect(resolveRelativePath('../../', '/users/posva/a/b')).toBe('/users/')
     expect(resolveRelativePath('..', '/users/posva/new')).toBe('/users/')
index 9e68711126143b1a38161a20f35ed1e0855d3087..5b7ea7b29f7dac67bf9c84bf41d752a8058050bd 100644 (file)
@@ -444,6 +444,9 @@ describe('Router', () => {
     await router.push('/users/posva')
     await router.push('../../../add')
     expect(router.currentRoute.value.path).toBe('/add')
+    await router.push('/users/posva')
+    await router.push('../')
+    expect(router.currentRoute.value.path).toBe('/')
   })
 
   describe('alias', () => {