feat(platform): refine customer alert evidence copy

This commit is contained in:
lingniu
2026-07-05 11:49:07 +08:00
parent 2b423a3643
commit 856e4f7dfc
4 changed files with 57 additions and 56 deletions

View File

@@ -166,8 +166,8 @@ test('exposes AMap operations shortcuts when map key is configured', async () =>
severity: 'ok',
status: '生产可用',
evidence: '在线 174/424缺失车辆 609Kafka Lag 42',
action: '保持实时、轨迹、RAW 和统计链路巡检。',
acceptance: '车辆服务可回查实时、轨迹和 RAW 证据。',
action: '保持实时、轨迹、原始记录和统计链路巡检。',
acceptance: '车辆服务可回查实时、轨迹和原始记录。',
vehiclesHash: '#/vehicles?protocol=JT808&missingProtocol=JT808',
realtimeHash: '#/realtime?protocol=JT808&online=online',
historyHash: '#/history-query?protocol=JT808&tab=raw&includeFields=true',
@@ -362,8 +362,8 @@ test('shows global alert pressure from notification plan in topbar', async () =>
severity: 'ok',
status: '生产可用',
evidence: '在线 11/50缺失车辆 983Kafka Lag 0',
action: '保持实时、轨迹、RAW 和统计链路巡检。',
acceptance: '车辆服务可回查实时、轨迹和 RAW 证据。',
action: '保持实时、轨迹、原始记录和统计链路巡检。',
acceptance: '车辆服务可回查实时、轨迹和原始记录。',
vehiclesHash: '#/vehicles?protocol=YUTONG_MQTT&missingProtocol=YUTONG_MQTT',
realtimeHash: '#/realtime?protocol=YUTONG_MQTT&online=online',
historyHash: '#/history-query?protocol=YUTONG_MQTT&tab=raw&includeFields=true',
@@ -667,8 +667,8 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
severity: 'ok',
status: '生产可用',
evidence: '在线 11/50缺失车辆 983Kafka Lag 0',
action: '保持实时、轨迹、RAW 和统计链路巡检。',
acceptance: '车辆服务可回查实时、轨迹和 RAW 证据。',
action: '保持实时、轨迹、原始记录和统计链路巡检。',
acceptance: '车辆服务可回查实时、轨迹和原始记录。',
vehiclesHash: '#/vehicles?protocol=YUTONG_MQTT&missingProtocol=YUTONG_MQTT',
realtimeHash: '#/realtime?protocol=YUTONG_MQTT&online=online',
historyHash: '#/history-query?protocol=YUTONG_MQTT&tab=raw&includeFields=true',
@@ -3660,7 +3660,7 @@ test('shows alert rule and notification policy workspace on quality page', async
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('影响车辆3 辆问题记录5 条'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('客户处置路径:'));
expect(await screen.findByText('告警事件与通知中心')).toBeInTheDocument();
expect(screen.getByText('客户处置:先判断影响车辆和优先级,再通知责任团队,并用实时、轨迹、RAW、里程证据闭环。', { exact: false })).toBeInTheDocument();
expect(screen.getByText('客户处置:先判断影响车辆和优先级,再通知责任团队,并用实时、轨迹、原始记录、里程证据闭环。', { exact: false })).toBeInTheDocument();
expect(screen.getByText('链路状态')).toBeInTheDocument();
expect(screen.getAllByText('优先队列').length).toBeGreaterThanOrEqual(1);
expect(await screen.findByText('告警触发规则')).toBeInTheDocument();
@@ -4064,14 +4064,14 @@ test('renders notification rules as a standalone operations page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. [P0] 无来源规则 / 平台接入 / 命中 3 / SLA 30 分钟确认'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('建议动作:确认平台转发 - 核对平台转发配置'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=VIN-RULES-001'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW证据http://localhost:3000/#/history-query?keyword=VIN-RULES-001&tab=raw'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('原始记录http://localhost:3000/#/history-query?keyword=VIN-RULES-001&tab=raw'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('超过升级窗口未恢复时'));
fireEvent.click(screen.getByRole('button', { name: '复制通知演练包' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【告警通知演练包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('运行版本platform-rules-test'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('规则规模P0 1 类P1 1 类,待通知 1 条'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('P0策略P0 实时中断 / 接入运维 + 业务责任人 / 邮件 / 企业微信 / 30 分钟升级'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. 对第一条待通知告警打开车辆服务、实时、轨迹、RAW 四类证据'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. 对第一条待通知告警打开车辆服务、实时、轨迹、原始记录四类证据'));
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: '复制通知执行矩阵' }));
@@ -4357,7 +4357,7 @@ test('copies notification text from quality priority queue', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('详情:手机号未映射 VIN需要维护 binding'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时定位http://localhost:3000/#/realtime?keyword=%E7%B2%A4A%E9%80%9A%E7%9F%A51&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹证据http://localhost:3000/#/history?keyword=%E7%B2%A4A%E9%80%9A%E7%9F%A51&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW证据http://localhost:3000/#/history-query?keyword=%E7%B2%A4A%E9%80%9A%E7%9F%A51&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('原始记录http://localhost:3000/#/history-query?keyword=%E7%B2%A4A%E9%80%9A%E7%9F%A51&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=%E7%B2%A4A%E9%80%9A%E7%9F%A51&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警筛选http://localhost:3000/#/alert-events'));
});
@@ -4447,9 +4447,9 @@ test('copies dispatch ticket from quality priority queue', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('建议动作:维护身份绑定'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('处置步骤:'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. 打开车辆服务核对当前身份解析结果'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. 核对实时定位、轨迹证据和 RAW 证据'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. 核对实时定位、轨迹证据和原始记录'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('3. 完成后确认车辆服务状态恢复,问题不再命中当前告警'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('验收标准:车辆能解析到 VIN实时/历史/RAW 证据可通过同一车辆服务查询'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('验收标准:车辆能解析到 VIN实时历史和原始记录可通过同一车辆服务查询'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=%E7%B2%A4A%E5%B7%A5%E5%8D%951&protocol=JT808'));
});
@@ -4553,7 +4553,7 @@ test('copies priority queue notification digest on quality page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('统一验收:来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. [P0] 粤A汇总1 / VIN-DIGEST-001'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时http://localhost:3000/#/realtime?keyword=VIN-DIGEST-001&protocol=VEHICLE_SERVICE'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAWhttp://localhost:3000/#/history-query?keyword=VIN-DIGEST-001&protocol=VEHICLE_SERVICE&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('原始记录http://localhost:3000/#/history-query?keyword=VIN-DIGEST-001&protocol=VEHICLE_SERVICE&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('2. [P1] 粤A汇总2 / 13307795426'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('通知规则http://localhost:3000/#/notification-rules'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('运维质量http://localhost:3000/#/ops-quality'));
@@ -4667,7 +4667,7 @@ test('copies notification text from regular quality issue row', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('验收标准:缺失字段恢复解析,统计、定位或里程依赖的核心字段可查询'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时定位http://localhost:3000/#/realtime?keyword=VIN-ROW-NOTIFY&protocol=GB32960'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放http://localhost:3000/#/history?keyword=VIN-ROW-NOTIFY&protocol=GB32960&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW证据http://localhost:3000/#/history-query?keyword=VIN-ROW-NOTIFY&protocol=GB32960'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('原始记录http://localhost:3000/#/history-query?keyword=VIN-ROW-NOTIFY&protocol=GB32960'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('includeFields=true'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程复核http://localhost:3000/#/mileage?keyword=VIN-ROW-NOTIFY&protocol=GB32960&dateFrom=2026-07-03&dateTo=2026-07-04'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务http://localhost:3000/#/detail?keyword=VIN-ROW-NOTIFY&protocol=GB32960'));
@@ -4913,7 +4913,7 @@ test('opens same-day raw evidence from quality priority queue', async () => {
issueType: 'LINK_GAP',
severity: 'error',
lastSeen: '2026-07-03 20:12:10',
detail: 'JT808 来源间断,需要核对 RAW'
detail: 'JT808 来源间断,需要核对原始记录'
}],
total: 1,
limit: 20,
@@ -4947,7 +4947,8 @@ test('opens same-day raw evidence from quality priority queue', async () => {
render(<App />);
expect(await screen.findByText('处置优先队列')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'RAW证据' }));
const rawEvidenceButtons = screen.getAllByRole('button', { name: '原始记录' });
fireEvent.click(rawEvidenceButtons[rawEvidenceButtons.length - 1]);
await waitFor(() => {
expect(window.location.hash.startsWith('#/history-query?')).toBe(true);
@@ -5304,7 +5305,7 @@ test('opens same-day raw evidence from quality issue row', async () => {
render(<App />);
expect(await screen.findByText('VIN-QUALITY-RAW')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '核对 RAW' }));
fireEvent.click(screen.getByRole('button', { name: '核对原始' }));
await waitFor(() => {
expect(window.location.hash.startsWith('#/history-query?')).toBe(true);
@@ -10276,7 +10277,7 @@ test('opens realtime status from quality issue row with source evidence', async
render(<App />);
expect(await screen.findByText('13307795425')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '实时状态' }));
fireEvent.click(screen.getAllByRole('button', { name: '实时状态' })[0]);
await waitFor(() => {
expect(window.location.hash).toBe('#/realtime?keyword=%E7%B2%A4AG18312&protocol=JT808');