Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Apr 17, 2024
1 parent e4805e6 commit 87b4e49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/router/__tests__/router.spec.ts
Expand Up @@ -534,6 +534,18 @@ describe('Router', () => {
})
})

// https://github.com/vuejs/router/issues/2187
it('keeps a consistent value on fullPath when resolving', async () => {
const { router } = await newRouter()
const targetLoc = '/search#/?redirect=%2F%3Fid%3D1%23%2Fabc'
expect(router.resolve(targetLoc).fullPath).toBe(targetLoc)
await router.push(targetLoc)
expect(router.currentRoute.value.fullPath).toBe(targetLoc)
await router.push('/')
await router.replace(targetLoc)
expect(router.currentRoute.value.fullPath).toBe(targetLoc)
})

describe('navigation cancelled', () => {
async function checkNavigationCancelledOnPush(
target?: RouteLocationRaw | false
Expand Down

0 comments on commit 87b4e49

Please sign in to comment.