feat(platform): add alert business impact board

This commit is contained in:
lingniu
2026-07-04 22:24:06 +08:00
parent b3b4e2203a
commit 24897850f3
3 changed files with 172 additions and 0 deletions

View File

@@ -3236,6 +3236,16 @@ test('shows alert rule and notification policy workspace on quality page', async
render(<App />);
expect(await screen.findByText('告警触发规则')).toBeInTheDocument();
expect(screen.getByText('业务影响评估')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '复制业务影响报告' })).toBeInTheDocument();
expect(screen.getAllByText('高风险').length).toBeGreaterThan(0);
expect(screen.getByText('3 辆受影响')).toBeInTheDocument();
expect(screen.getByText('影响车辆')).toBeInTheDocument();
expect(screen.getByText('3 辆')).toBeInTheDocument();
expect(screen.getByText('P0 0 / P1 0')).toBeInTheDocument();
expect(screen.getAllByText('车辆服务').length).toBeGreaterThan(0);
expect(screen.getAllByText('暂无数据来源').length).toBeGreaterThan(0);
expect(screen.getAllByText('异常').length).toBeGreaterThan(0);
expect(screen.getByText('4 类活跃')).toBeInTheDocument();
expect(screen.getByText('3 类 P0')).toBeInTheDocument();
expect(screen.getByText('容量与存储风险')).toBeInTheDocument();
@@ -3251,6 +3261,14 @@ test('shows alert rule and notification policy workspace on quality page', async
expect(screen.getByText('30 分钟升级')).toBeInTheDocument();
expect(screen.getByText('验收:来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '复制业务影响报告' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【告警业务影响报告】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('运行版本platform-20260704155607'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('影响等级:高风险'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('影响车辆3 辆'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('主要来源:车辆服务 3 条'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('主要问题:暂无数据来源 2 条'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('容量风险存储异常Kafka Lag 42容量发现 1 项'));
fireEvent.click(screen.getByRole('button', { name: '复制通知策略Runbook' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【告警通知策略Runbook】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('运行版本platform-20260704155607'));