refactor(ui): refine semi access workspace

This commit is contained in:
lingniu
2026-07-19 19:27:43 +08:00
parent 2c93999417
commit 58f2a77033
4 changed files with 151 additions and 65 deletions
@@ -91,6 +91,16 @@ test('removes old access rows immediately when the vehicle filter scope changes'
expect(scrollBy).toHaveBeenCalledWith({ left: -260, behavior: 'smooth' });
expect(screen.getByRole('columnheader', { name: '车辆' })).toHaveClass('semi-table-cell-fixed-left', 'v2-access-vehicle-column');
expect(screen.getByRole('columnheader', { name: '品牌 / 车型' })).toHaveClass('semi-table-cell-fixed-left', 'v2-access-model-column');
const protocolHeaders = [
{ label: 'GB/T 32960', description: '国标远程服务' },
{ label: 'JT/T 808', description: '道路运输终端' },
{ label: '宇通 MQTT', description: '宇通车辆平台' }
];
for (const protocol of protocolHeaders) {
const header = screen.getByRole('columnheader', { name: new RegExp(protocol.label.replace('/', '\\/')) });
expect(within(header).getByText(protocol.label).closest('.semi-tag')).toHaveClass('v2-protocol-tag', 'is-compact');
expect(within(header).getByText(protocol.description)).toBeInTheDocument();
}
const desktopRow = screen.getByTestId('access-row-OLDVIN');
expect(desktopRow).toHaveAttribute('role', 'button');
expect(desktopRow).toHaveAttribute('aria-expanded', 'false');
@@ -108,6 +118,10 @@ test('removes old access rows immediately when the vehicle filter scope changes'
expect(healthOverview).toHaveTextContent('当前在线1');
expect(healthOverview).toHaveTextContent('异常来源0');
expect(healthOverview).toHaveTextContent('资料状态已维护');
expect(detailDialog.querySelectorAll('.v2-access-protocol-title .v2-protocol-tag')).toHaveLength(3);
expect(within(detailDialog).getByText('GB/T 32960')).toBeInTheDocument();
expect(within(detailDialog).getByText('JT/T 808')).toBeInTheDocument();
expect(within(detailDialog).getByText('宇通 MQTT')).toBeInTheDocument();
expect(detailDialog.querySelector('.v2-access-inspector-header')).not.toBeInTheDocument();
fireEvent.change(screen.getByRole('textbox', { name: '车辆' }), { target: { value: 'NEWVIN' } });
fireEvent.click(screen.getByRole('button', { name: '查询' }));