]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: remove outdated error
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 8 Apr 2020 18:45:08 +0000 (20:45 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 8 Apr 2020 18:45:08 +0000 (20:45 +0200)
__tests__/errors.spec.ts

index 92e115b2428ee839e47fd26c43307f9563b15bab..2d7d3fbd3ca1bd816a41f2430c19bfb57fef057c 100644 (file)
@@ -53,35 +53,4 @@ describe('Errors', () => {
       expect.objectContaining({ type: ErrorTypes.NAVIGATION_ABORTED })
     )
   })
-
-  it('triggers errors caused by new navigations of a next(redirect) triggered by history', async () => {
-    const { router, history } = createRouter()
-    await router.push('/p/0')
-    await router.push('/p/other')
-
-    router.beforeEach((to, from, next) => {
-      const p = (Number(to.params.p) || 0) + 1
-      if (p === 2) next(false)
-      else next({ name: 'Param', params: { p: '' + p } })
-    })
-
-    history.back()
-    await tick()
-
-    expect(onError).toHaveBeenCalledTimes(2)
-    expect(onError).toHaveBeenNthCalledWith(
-      1,
-      expect.objectContaining({ type: ErrorTypes.NAVIGATION_GUARD_REDIRECT })
-    )
-    expect(onError.mock.calls[0]).toMatchObject([
-      { to: { params: { p: '1' } }, from: { fullPath: '/p/0' } },
-    ])
-    expect(onError).toHaveBeenNthCalledWith(
-      2,
-      expect.objectContaining({ type: ErrorTypes.NAVIGATION_ABORTED })
-    )
-    expect(onError.mock.calls[1]).toMatchObject([
-      { to: { params: { p: '1' } }, from: { params: { p: 'other' } } },
-    ])
-  })
 })