feat(platform): add online status handoff
This commit is contained in:
@@ -7023,6 +7023,11 @@ test('shows mileage statistics workspace with trend source and definition', asyn
|
||||
|
||||
test('shows vehicle-first statistics domains for one vehicle service', async () => {
|
||||
window.history.replaceState(null, '', '/#/mileage?keyword=VIN-STATS-SERVICE&protocol=JT808');
|
||||
const writeText = vi.fn(() => Promise.resolve());
|
||||
Object.defineProperty(navigator, 'clipboard', {
|
||||
configurable: true,
|
||||
value: { writeText }
|
||||
});
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const path = String(input);
|
||||
if (path.includes('/api/mileage/summary')) {
|
||||
@@ -7145,6 +7150,13 @@ test('shows vehicle-first statistics domains for one vehicle service', async ()
|
||||
expect(await screen.findByText('VIN-STATS-SERVICE-OFFLINE')).toBeInTheDocument();
|
||||
expect(screen.getByText('粤A离线1')).toBeInTheDocument();
|
||||
expect(screen.getByText('2 小时')).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: '复制在线状态清单' }));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【车辆在线状态交接】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆范围:VIN-STATS-SERVICE'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线概览:3 在线 / 1 离线 / 在线率 75%'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('协议在线:JT808 2/3;GB32960 1/2'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. 粤A离线1 / VIN-STATS-SERVICE-OFFLINE / 广安车联'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('离线时长:2 小时;最后上报:2026-07-03 18:12:10'));
|
||||
});
|
||||
|
||||
test('copies mileage statistics summary for operations reporting', async () => {
|
||||
|
||||
Reference in New Issue
Block a user