feat(platform): include alert escalation in digest

This commit is contained in:
lingniu
2026-07-04 15:53:29 +08:00
parent 1838da4b02
commit fd93ce8d97
2 changed files with 40 additions and 2 deletions

View File

@@ -524,6 +524,30 @@ test('dashboard exposes vehicle command center map actions', async () => {
})
} as Response;
}
if (path.includes('/api/quality/notification-plan')) {
return {
ok: true,
json: async () => ({
data: {
summary: {
issueVehicleCount: 2,
issueRecordCount: 2,
errorCount: 1,
warningCount: 1,
protocols: [{ name: 'VEHICLE_SERVICE', count: 1 }, { name: 'JT808', count: 1 }],
issueTypes: [{ name: 'NO_SOURCE', count: 1 }, { name: 'VIN_MISSING', count: 1 }]
},
rules: [],
policies: [{ name: 'P0 实时中断', target: '接入运维 + 业务责任人', channel: '站内告警 / 邮件 / 企业微信', condition: '无来源、VIN 缺失、存储不可写', escalationMinutes: 30, acceptanceCriteria: '来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据' }],
priorityIssues: [],
activeRuleCount: 1,
p0RuleCount: 1
},
traceId: 'trace-test',
timestamp: 1783094400000
})
} as Response;
}
if (path.includes('/api/quality/issues')) {
return {
ok: true,
@@ -3419,6 +3443,8 @@ test('copies priority queue notification digest on quality page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【告警优先队列汇总】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('运行版本platform-20260704153951'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('通知升级P0 实时中断 / 30 分钟升级 / 接入运维 + 业务责任人'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('验收标准:来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('P01 条P11 条'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. [P0] 粤A汇总1 / VIN-DIGEST-001'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('确认平台转发'));