feat(platform): add alert sla escalation board

This commit is contained in:
lingniu
2026-07-04 21:34:39 +08:00
parent da3a639dd8
commit 5d57efabea
3 changed files with 203 additions and 5 deletions

View File

@@ -3177,8 +3177,8 @@ test('shows alert rule and notification policy workspace on quality page', async
expect(screen.getByRole('button', { name: '分派团队 车辆档案' })).toHaveTextContent('主问题VIN 缺失');
expect(screen.getByRole('button', { name: '分派团队 基础设施' })).toHaveTextContent('SLA15 分钟恢复');
expect(screen.getByText('通知策略')).toBeInTheDocument();
expect(screen.getByText('P0 实时中断')).toBeInTheDocument();
expect(screen.getByText('接入运维 + 业务责任人')).toBeInTheDocument();
expect(screen.getAllByText('P0 实时中断').length).toBeGreaterThan(0);
expect(screen.getAllByText('接入运维 + 业务责任人').length).toBeGreaterThan(0);
expect(screen.getByText('站内告警 / 邮件 / 企业微信')).toBeInTheDocument();
expect(screen.getByText('30 分钟升级')).toBeInTheDocument();
expect(screen.getByText('验收:来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据')).toBeInTheDocument();
@@ -3489,13 +3489,17 @@ test('renders notification rules as a standalone operations page', async () => {
expect(await screen.findByRole('heading', { name: '通知规则' })).toBeInTheDocument();
expect(screen.getByText('无来源规则')).toBeInTheDocument();
expect(screen.getByText('车辆无任何来源证据')).toBeInTheDocument();
expect(screen.getByText('P0 实时中断')).toBeInTheDocument();
expect(screen.getByText('接入运维 + 业务责任人')).toBeInTheDocument();
expect(screen.getAllByText('P0 实时中断').length).toBeGreaterThan(0);
expect(screen.getAllByText('接入运维 + 业务责任人').length).toBeGreaterThan(0);
expect(screen.getByText('告警处置队列')).toBeInTheDocument();
expect(screen.getByText('下一步处置')).toBeInTheDocument();
expect(screen.getByText('主责任方')).toBeInTheDocument();
expect(screen.getAllByText('证据完整').length).toBeGreaterThan(0);
expect(screen.getByText('核对平台转发配置')).toBeInTheDocument();
expect(screen.getByText('SLA升级态势')).toBeInTheDocument();
expect(screen.getAllByText('已超时').length).toBeGreaterThan(0);
expect(screen.getByText('即将升级')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '复制SLA升级报告' })).toBeInTheDocument();
expect(screen.getByText('当前待通知告警')).toBeInTheDocument();
expect(screen.getAllByText('粤A规则1 / VIN-RULES-001').length).toBeGreaterThan(0);
expect(screen.getByText('确认平台转发')).toBeInTheDocument();
@@ -3530,9 +3534,14 @@ test('renders notification rules as a standalone operations page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. 对第一条待通知告警打开车辆服务、实时、轨迹、RAW 四类证据'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('通知文本【P0 告警通知】通知规则页待通知'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹证据http://localhost:3000/#/history?keyword=VIN-RULES-001'));
fireEvent.click(screen.getByRole('button', { name: '复制SLA升级报告' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【告警SLA升级报告】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('升级态势:已超时 1 / 即将升级 0 / 正常跟进 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('[P0] 粤A规则1 / VIN-RULES-001'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('策略P0 实时中断 / 接入运维 + 业务责任人 / 30 分钟升级'));
fireEvent.click(screen.getByRole('button', { name: '复制单条告警通知' }));
expect(writeText).toHaveBeenCalledWith('【P0 告警通知】通知规则页待通知');
fireEvent.click(screen.getByRole('button', { name: '车辆服务' }));
fireEvent.click(screen.getAllByRole('button', { name: '车辆服务' })[0]);
expect(window.location.hash).toBe('#/detail?keyword=VIN-RULES-001');
});