feat: unify mobile track workspace

This commit is contained in:
lingniu
2026-07-19 07:58:51 +08:00
parent 6795a8ea6d
commit af71468e63
4 changed files with 89 additions and 21 deletions

View File

@@ -270,23 +270,28 @@ test('uses the shared Semi editor SideSheet for mobile track criteria and eviden
return element;
});
expect(sheet).toHaveClass('semi-sidesheet-inner');
expect(sheet).toHaveAttribute('id', 'v2-track-mobile-workbench');
expect(document.querySelector('.v2-track-detail-sidesheet')).toHaveClass('v2-workspace-editor-sidesheet', 'semi-sidesheet-bottom');
expect(document.querySelector('.v2-track-detail-sidesheet .v2-track-rail')).toBeInTheDocument();
expect(document.querySelector('.v2-track-detail-sidesheet .v2-track-query-summary')).not.toBeInTheDocument();
expect(screen.getByLabelText('轨迹查询任务栏')).toHaveTextContent('粤A12345');
expect(screen.queryByLabelText('轨迹查询任务栏')).not.toBeInTheDocument();
expect(screen.queryByRole('textbox', { name: '搜索轨迹车辆' })).not.toBeInTheDocument();
expect(screen.getByText('07-15 00:00 07-15 23:59 · 自动来源')).toBeInTheDocument();
expect(screen.getByText('8 km · 1 个停留 · 3 个事件')).toBeInTheDocument();
expect(sheet).toHaveStyle({ height: 'min(82dvh, 326px)' });
expect(screen.getAllByText('07-15 00:00 07-15 23:59 · 自动来源')).toHaveLength(2);
expect(screen.getByRole('list', { name: '轨迹查询与明细摘要' })).toHaveTextContent('行程里程8 km00:20:00停留 / 事件1 / 3地图证据点数据点3时间窗完整');
expect(screen.getByRole('button', { name: '修改轨迹查询' })).toHaveTextContent('修改查询');
expect(screen.getByRole('button', { name: /查看地图$/ })).toBeInTheDocument();
expect(sheet).toHaveStyle({ height: 'min(88dvh, 394px)' });
fireEvent.click(screen.getByRole('tab', { name: /事件点/ }));
await waitFor(() => expect(sheet).toHaveStyle({ height: 'min(82dvh, 450px)' }));
await waitFor(() => expect(sheet).toHaveStyle({ height: 'min(88dvh, 518px)' }));
fireEvent.click(screen.getByRole('tab', { name: /停留点/ }));
fireEvent.click(screen.getByRole('button', { name: /停留 00:05:00/ }));
expect(view.container.querySelector('.v2-track-page')).toHaveClass('is-rail-collapsed');
fireEvent.click(screen.getByRole('button', { name: '打开轨迹详情' }));
await screen.findByRole('dialog', { name: '轨迹查询与明细' });
fireEvent.click(screen.getByRole('button', { name: '修改条件' }));
fireEvent.click(screen.getByRole('button', { name: '修改轨迹查询' }));
expect(screen.getByRole('textbox', { name: '搜索轨迹车辆' })).toHaveValue('LTEST000000000001');
expect(screen.getByRole('button', { name: '收起轨迹查询' })).toHaveTextContent('收起查询');
expect(sheet).toHaveStyle({ height: 'min(88dvh, 780px)' });
expect(screen.getByRole('button', { name: '关闭轨迹查询与明细' })).toBeInTheDocument();
});
@@ -299,6 +304,7 @@ test('keeps one clear mobile query entry before a vehicle is selected', async ()
expect(screen.queryByRole('button', { name: '打开轨迹详情' })).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /选择车辆/ }));
expect(await screen.findByRole('dialog', { name: '轨迹查询与明细' })).toBeInTheDocument();
expect(screen.getByRole('list', { name: '轨迹查询与明细摘要' })).toHaveTextContent('查询状态待查询请先选择车辆');
expect(screen.getByRole('textbox', { name: '搜索轨迹车辆' })).toBeInTheDocument();
});