})
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()
})
)
})
+
+ it('allows navigating to invalid unencoded params (IE and Edge)', async () => {
+ const spy = jest.spyOn(console, 'warn').mockImplementation(() => {})
+ const history = createHistory('/p/%notvalid')
+ const router = new Router({ history, routes })
+ await router.doInitialNavigation()
+ expect(spy).toHaveBeenCalledTimes(1)
+ spy.mockRestore()
+ 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: '%notvalid' },
+ })
+ )
+ })
})
})