feat(platform): export dashboard snapshot
This commit is contained in:
@@ -1109,6 +1109,8 @@ test('dashboard copies highest priority quality issue notification text', async
|
||||
configurable: true,
|
||||
value: { writeText }
|
||||
});
|
||||
const createObjectURL = vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:dashboard-snapshot');
|
||||
const revokeObjectURL = vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => undefined);
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const path = String(input);
|
||||
if (path.includes('/api/ops/health')) {
|
||||
@@ -1238,6 +1240,11 @@ test('dashboard copies highest priority quality issue notification text', async
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史RAW:http://localhost:3000/#/history-query?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警事件:http://localhost:3000/#/alert-events?issueType=VIN_MISSING'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务:http://localhost:3000/#/detail?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808'));
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: '导出驾驶舱 CSV' }));
|
||||
|
||||
expect(createObjectURL).toHaveBeenCalled();
|
||||
expect(revokeObjectURL).toHaveBeenCalledWith('blob:dashboard-snapshot');
|
||||
});
|
||||
|
||||
test('dashboard keeps core vehicle service metrics when preview requests fail', async () => {
|
||||
|
||||
Reference in New Issue
Block a user