refine Semi UI access workspace

This commit is contained in:
lingniu
2026-07-18 15:27:47 +08:00
parent b764ba1be8
commit 8a2edc8bc9
4 changed files with 72 additions and 12 deletions

View File

@@ -170,6 +170,16 @@ test('renders mobile access vehicles as selectable Semi cards', async () => {
expect(within(action).getByText('808')).toBeInTheDocument();
expect(within(action).getByText('宇通')).toBeInTheDocument();
expect(screen.queryByLabelText('每页车辆数')).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: '打开接入治理' })).toHaveTextContent('治理');
const toolsButton = screen.getByRole('button', { name: '打开接入管理工具' });
expect(toolsButton).toHaveTextContent('工具');
expect(screen.queryByRole('menuitem', { name: /导出当前页/ })).not.toBeInTheDocument();
fireEvent.click(toolsButton);
await waitFor(() => expect(toolsButton).toHaveAttribute('aria-expanded', 'true'));
expect(screen.getByRole('menuitem', { name: /导出当前页/ })).toBeInTheDocument();
fireEvent.click(screen.getByRole('menuitem', { name: /刷新数据/ }));
await waitFor(() => expect(mocks.accessSummary).toHaveBeenCalledTimes(2));
expect(toolsButton).toHaveAttribute('aria-expanded', 'false');
expect(action).toHaveAttribute('aria-pressed', 'false');
expect(action).toHaveAttribute('aria-expanded', 'false');
fireEvent.click(action);