]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: allow unencoded params
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 16 Aug 2019 16:21:09 +0000 (18:21 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 16 Aug 2019 16:21:09 +0000 (18:21 +0200)
__tests__/url-encoding.spec.js

index 05d118ef2cd35bfa6a0ed5db30a15c69d32bf3d3..b21e2232920459122a8818f2a6c69617058ccdc7 100644 (file)
@@ -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: '€' },
+        })
+      )
+    })
   })
 })