feat(platform-web): preserve protocol in vehicle links
This commit is contained in:
@@ -3,9 +3,10 @@ import { buildAppHash, parseAppHash } from './appRoute';
|
||||
|
||||
describe('parseAppHash', () => {
|
||||
test('parses detail page keyword from hash query', () => {
|
||||
expect(parseAppHash('#/detail?keyword=%E7%B2%A4AG18312')).toEqual({
|
||||
expect(parseAppHash('#/detail?keyword=%E7%B2%A4AG18312&protocol=JT808')).toEqual({
|
||||
page: 'detail',
|
||||
keyword: '粤AG18312'
|
||||
keyword: '粤AG18312',
|
||||
protocol: 'JT808'
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,7 +17,7 @@ describe('parseAppHash', () => {
|
||||
|
||||
describe('buildAppHash', () => {
|
||||
test('builds shareable vehicle page hash with encoded keyword', () => {
|
||||
expect(buildAppHash({ page: 'history', keyword: '粤AG18312' })).toBe('#/history?keyword=%E7%B2%A4AG18312');
|
||||
expect(buildAppHash({ page: 'history', keyword: '粤AG18312', protocol: 'GB32960' })).toBe('#/history?keyword=%E7%B2%A4AG18312&protocol=GB32960');
|
||||
});
|
||||
|
||||
test('builds page-only hash when keyword is empty', () => {
|
||||
|
||||
Reference in New Issue
Block a user