From: Eduardo San Martin Morote Date: Wed, 8 Apr 2020 18:45:08 +0000 (+0200) Subject: test: remove outdated error X-Git-Tag: v4.0.0-alpha.6~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a575f499be2ab8f557f469801965eb129ca505e1;p=thirdparty%2Fvuejs%2Frouter.git test: remove outdated error --- diff --git a/__tests__/errors.spec.ts b/__tests__/errors.spec.ts index 92e115b2..2d7d3fbd 100644 --- a/__tests__/errors.spec.ts +++ b/__tests__/errors.spec.ts @@ -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' } } }, - ]) - }) })