refine Semi UI access governance

This commit is contained in:
lingniu
2026-07-18 19:12:07 +08:00
parent 84684f2dc1
commit 5d4aa92cc1
3 changed files with 327 additions and 8 deletions

View File

@@ -133,13 +133,28 @@ test('reports and independently retries unresolved identity and threshold failur
const identityTitle = await screen.findByText('来源身份待绑定');
const identityCollapse = identityTitle.closest<HTMLElement>('.semi-collapse');
expect(identityCollapse).toHaveClass('v2-access-identity-queue-v3');
expect(identityTitle.closest('.semi-collapse-header')).toHaveAttribute('aria-expanded', 'true');
expect(within(identityCollapse!).getByText('1 条').closest('.semi-tag')).toBeTruthy();
expect(within(identityCollapse!).getByText('138****0001').closest('.semi-card')).toHaveClass('v2-access-identity-card');
expect(within(identityCollapse!).getByText('来源标识')).toBeInTheDocument();
expect(within(identityCollapse!).getByText('关联车牌')).toBeInTheDocument();
expect(within(identityCollapse!).getByText('最后出现')).toBeInTheDocument();
expect(within(identityCollapse!).getByText('建议动作')).toBeInTheDocument();
const thresholdTitle = await screen.findByText('在线判定阈值');
const thresholdCollapse = thresholdTitle.closest<HTMLElement>('.semi-collapse');
expect(thresholdCollapse).toHaveClass('v2-access-settings');
expect(within(thresholdCollapse!).getByText('v1').closest('.semi-tag')).toBeTruthy();
expect(thresholdTitle.closest('.semi-collapse-header')).toHaveAttribute('aria-expanded', 'false');
expect(within(thresholdCollapse!).queryByRole('spinbutton')).not.toBeInTheDocument();
fireEvent.click(thresholdTitle.closest('.semi-collapse-header')!);
expect(thresholdTitle.closest('.semi-collapse-header')).toHaveAttribute('aria-expanded', 'true');
expect(within(thresholdCollapse!).getAllByRole('spinbutton')).toHaveLength(6);
expect(within(thresholdCollapse!).getByText('通用判定')).toBeInTheDocument();
expect(within(thresholdCollapse!).getByText('协议在线阈值')).toBeInTheDocument();
expect(within(thresholdCollapse!).getAllByText('5 分 0 秒').length).toBeGreaterThan(0);
expect(within(thresholdCollapse!).getByText('1 分 0 秒')).toBeInTheDocument();
expect(within(thresholdCollapse!).getByText('24 小时')).toBeInTheDocument();
expect(screen.queryByText('待绑定身份服务超时')).not.toBeInTheDocument();
expect(screen.queryByText('阈值配置读取失败')).not.toBeInTheDocument();
expect(mocks.accessUnresolvedIdentities).toHaveBeenCalledTimes(2);