feat(platform-web): link summary kpis to vehicle filters
This commit is contained in:
@@ -6,7 +6,20 @@ describe('parseAppHash', () => {
|
||||
expect(parseAppHash('#/detail?keyword=%E7%B2%A4AG18312&protocol=JT808')).toEqual({
|
||||
page: 'detail',
|
||||
keyword: '粤AG18312',
|
||||
protocol: 'JT808'
|
||||
protocol: 'JT808',
|
||||
filters: {}
|
||||
});
|
||||
});
|
||||
|
||||
test('parses vehicle list filters from hash query', () => {
|
||||
expect(parseAppHash('#/vehicles?coverage=multi&serviceStatus=degraded&online=online&bindingStatus=bound')).toEqual({
|
||||
page: 'vehicles',
|
||||
filters: {
|
||||
coverage: 'multi',
|
||||
serviceStatus: 'degraded',
|
||||
online: 'online',
|
||||
bindingStatus: 'bound'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,6 +33,10 @@ describe('buildAppHash', () => {
|
||||
expect(buildAppHash({ page: 'history', keyword: '粤AG18312', protocol: 'GB32960' })).toBe('#/history?keyword=%E7%B2%A4AG18312&protocol=GB32960');
|
||||
});
|
||||
|
||||
test('builds shareable vehicle list hash with filters', () => {
|
||||
expect(buildAppHash({ page: 'vehicles', filters: { coverage: 'multi', serviceStatus: 'degraded' } })).toBe('#/vehicles?coverage=multi&serviceStatus=degraded');
|
||||
});
|
||||
|
||||
test('builds page-only hash when keyword is empty', () => {
|
||||
expect(buildAppHash({ page: 'quality', keyword: '' })).toBe('#/quality');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user