feat(platform): filter vehicles from missing source tags

This commit is contained in:
lingniu
2026-07-04 06:08:58 +08:00
parent 111154ed39
commit 1c210897bb
2 changed files with 17 additions and 2 deletions

View File

@@ -477,6 +477,11 @@ test('filters vehicle list by missing source evidence', async () => {
expect(screen.getAllByText('缺失来源').length).toBeGreaterThanOrEqual(2);
});
expect(screen.getAllByText('缺 YUTONG_MQTT').length).toBeGreaterThanOrEqual(1);
fireEvent.click(screen.getByRole('button', { name: '缺 YUTONG_MQTT' }));
expect(window.location.hash).toBe('#/vehicles?missingProtocol=YUTONG_MQTT');
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('missingProtocol=YUTONG_MQTT'), undefined);
});
fireEvent.click(screen.getByTestId('missing-protocol-filter'));
const mqttOptions = await screen.findAllByText('缺 YUTONG_MQTT');
fireEvent.click(mqttOptions[mqttOptions.length - 1]);