feat(platform): add alert policy runbook copy

This commit is contained in:
lingniu
2026-07-04 15:56:48 +08:00
parent fd93ce8d97
commit 7d6d1afbf2
2 changed files with 38 additions and 1 deletions

View File

@@ -2881,6 +2881,11 @@ test('renders quality issues as vehicle-service governance labels', async () =>
test('shows alert rule and notification policy workspace on quality page', async () => {
window.history.replaceState(null, '', '/#/quality');
const writeText = vi.fn(() => Promise.resolve());
Object.defineProperty(navigator, 'clipboard', {
configurable: true,
value: { writeText }
});
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
const path = String(input);
if (path.includes('/api/ops/health')) {
@@ -2961,6 +2966,12 @@ test('shows alert rule and notification policy workspace on quality page', async
expect(screen.getByText('站内告警 / 邮件 / 企业微信')).toBeInTheDocument();
expect(screen.getByText('30 分钟升级')).toBeInTheDocument();
expect(screen.getByText('验收:来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '复制通知策略Runbook' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【告警通知策略Runbook】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('P0 实时中断 / 接入运维 + 业务责任人'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('升级30 分钟升级'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('验收:来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据'));
});
test('shows actionable priority queue on quality page', async () => {