fix(router): correct the segment parsing so it won't break on ampersand (#23684)

PR Close #23684
This commit is contained in:
Jason Aden
2018-05-03 12:03:13 -07:00
committed by Igor Minar
parent f1097914c5
commit 8733843c11
2 changed files with 9 additions and 1 deletions

View File

@ -359,6 +359,14 @@ describe('url serializer', () => {
expect(url.serialize(parsed)).toBe(`/${notEncoded}${encoded}`);
});
it('should correctly encode ampersand in segments', () => {
const testUrl = '/parent&child';
const parsed = url.parse(testUrl);
expect(url.serialize(parsed)).toBe(testUrl);
});
});
describe('error handling', () => {