feat(platform): expose single-source vehicles

This commit is contained in:
lingniu
2026-07-04 04:18:20 +08:00
parent 0b53abf63d
commit 7f9d327f38
4 changed files with 10 additions and 3 deletions

View File

@@ -117,6 +117,8 @@ test('dashboard renders vehicle service summary metrics', async () => {
expect(await screen.findByText('总车辆')).toBeInTheDocument();
expect(screen.getByText('1,033')).toBeInTheDocument();
expect(screen.getByText('单源车辆')).toBeInTheDocument();
expect(screen.getByText('391')).toBeInTheDocument();
expect(screen.getByText('多源车辆')).toBeInTheDocument();
expect(screen.getByText('181')).toBeInTheDocument();
expect(screen.getByText('身份未绑定')).toBeInTheDocument();
@@ -169,12 +171,12 @@ test('opens vehicle list filtered by service summary KPI', async () => {
render(<App />);
fireEvent.click(await screen.findByRole('button', { name: /源车辆/ }));
fireEvent.click(await screen.findByRole('button', { name: /源车辆/ }));
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/vehicles/coverage?limit=20&offset=0&coverage=multi'), undefined);
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/vehicles/coverage?limit=20&offset=0&coverage=single'), undefined);
});
expect(window.location.hash).toBe('#/vehicles?coverage=multi');
expect(window.location.hash).toBe('#/vehicles?coverage=single');
});
test('shows vehicle service result summary on vehicle list filters', async () => {
@@ -258,6 +260,7 @@ test('shows vehicle service result summary on vehicle list filters', async () =>
expect(screen.getByText('过滤车辆')).toBeInTheDocument();
expect(screen.getByText('73')).toBeInTheDocument();
expect(screen.getByText('在线车辆')).toBeInTheDocument();
expect(screen.getByText('单源车辆')).toBeInTheDocument();
expect(screen.getByText('待绑定')).toBeInTheDocument();
expect(screen.getByText('VIN-MULTI-001')).toBeInTheDocument();
expect(screen.getAllByText('来源证据').length).toBeGreaterThanOrEqual(1);