feat(platform): filter vehicles by archive status

This commit is contained in:
lingniu
2026-07-04 09:37:51 +08:00
parent 817e5324f6
commit 29f84099b2
6 changed files with 55 additions and 4 deletions

View File

@@ -806,7 +806,7 @@ test('filters vehicle list from action queue', async () => {
});
test('shows and clears current vehicle service filters', async () => {
window.history.replaceState(null, '', '/#/vehicles?keyword=%E7%B2%A4A&protocol=JT808&coverage=multi&missingProtocol=YUTONG_MQTT&serviceStatus=degraded&online=online&bindingStatus=bound');
window.history.replaceState(null, '', '/#/vehicles?keyword=%E7%B2%A4A&protocol=JT808&coverage=multi&missingProtocol=YUTONG_MQTT&serviceStatus=degraded&online=online&bindingStatus=bound&archiveStatus=incomplete');
const fetchMock = vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
const path = String(input);
if (path.includes('/api/ops/health')) {
@@ -866,6 +866,10 @@ test('shows and clears current vehicle service filters', async () => {
expect(screen.getByText('服务状态:来源不完整')).toBeInTheDocument();
expect(screen.getByText('在线:在线')).toBeInTheDocument();
expect(screen.getByText('绑定:已绑定')).toBeInTheDocument();
expect(screen.getByText('档案:不完整')).toBeInTheDocument();
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('archiveStatus=incomplete'), undefined);
});
fireEvent.click(screen.getByRole('button', { name: '清空筛选' }));
await waitFor(() => {