feat(platform): export notification rules
This commit is contained in:
@@ -3360,6 +3360,8 @@ test('renders notification rules as a standalone operations page', async () => {
|
||||
configurable: true,
|
||||
value: { writeText }
|
||||
});
|
||||
const createObjectURL = vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:notification-rules');
|
||||
const revokeObjectURL = vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => undefined);
|
||||
const fetchMock = vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const path = String(input);
|
||||
if (path.includes('/api/ops/health')) {
|
||||
@@ -3456,6 +3458,9 @@ test('renders notification rules as a standalone operations page', async () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: '复制通知规则Runbook' }));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【通知规则Runbook】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('无来源规则 / P0 / 平台接入'));
|
||||
fireEvent.click(screen.getByRole('button', { name: '导出通知规则CSV' }));
|
||||
expect(createObjectURL).toHaveBeenCalled();
|
||||
expect(revokeObjectURL).toHaveBeenCalledWith('blob:notification-rules');
|
||||
fireEvent.click(screen.getByRole('button', { name: '复制待通知汇总' }));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【当前待通知告警】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('粤A规则1 / VIN-RULES-001'));
|
||||
|
||||
Reference in New Issue
Block a user