From: Eduardo San Martin Morote Date: Fri, 16 Aug 2019 16:21:09 +0000 (+0200) Subject: test: allow unencoded params X-Git-Tag: v4.0.0-alpha.0~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=613de379a355dfd3a0edad9cc4ca97a6c77659a5;p=thirdparty%2Fvuejs%2Frouter.git test: allow unencoded params --- diff --git a/__tests__/url-encoding.spec.js b/__tests__/url-encoding.spec.js index 05d118ef..b21e2232 100644 --- a/__tests__/url-encoding.spec.js +++ b/__tests__/url-encoding.spec.js @@ -48,5 +48,22 @@ describe('URL Encoding', () => { }) ) }) + + it('allows navigating to valid unencoded params (IE and Edge)', async () => { + // /p/€ + const history = createHistory('/p/€') + const router = new Router({ history, routes }) + await router.doInitialNavigation() + expect(router.currentRoute).toEqual( + expect.objectContaining({ + name: undefined, + // unfortunately, we cannot encode the path as we cannot know if it already encoded + // so comparing fullPath and path here is pointless + // fullPath: '/p/€', + // only the params matter + params: { p: '€' }, + }) + ) + }) }) })