Skip to content

Commit c69f75a

Browse files
committed
test: add more relative path
1 parent 76b56be commit c69f75a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/router/__tests__/location.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ describe('resolveRelativePath', () => {
359359
})
360360

361361
it('works without anything after the ..', () => {
362+
expect(resolveRelativePath('../', '/users/posva')).toBe('/')
362363
expect(resolveRelativePath('../', '/users/posva/new')).toBe('/users/')
363364
expect(resolveRelativePath('../../', '/users/posva/a/b')).toBe('/users/')
364365
expect(resolveRelativePath('..', '/users/posva/new')).toBe('/users/')

packages/router/__tests__/router.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ describe('Router', () => {
444444
await router.push('/users/posva')
445445
await router.push('../../../add')
446446
expect(router.currentRoute.value.path).toBe('/add')
447+
await router.push('/users/posva')
448+
await router.push('../')
449+
expect(router.currentRoute.value.path).toBe('/')
447450
})
448451

449452
describe('alias', () => {

0 commit comments

Comments
 (0)