feat(platform): add ops capacity handoff
This commit is contained in:
@@ -3497,6 +3497,11 @@ test('renders notification rules as a standalone operations page', async () => {
|
||||
|
||||
test('renders ops quality as a standalone runtime health page', async () => {
|
||||
window.history.replaceState(null, '', '/#/ops-quality');
|
||||
const writeText = vi.fn(() => Promise.resolve());
|
||||
Object.defineProperty(navigator, 'clipboard', {
|
||||
configurable: true,
|
||||
value: { writeText }
|
||||
});
|
||||
const fetchMock = vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const path = String(input);
|
||||
if (path.includes('/api/ops/health')) {
|
||||
@@ -3579,6 +3584,14 @@ test('renders ops quality as a standalone runtime health page', async () => {
|
||||
expect(screen.getAllByText('NATS 桥接待消费').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('桥接处置顺序')).toBeInTheDocument();
|
||||
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/ops/health'), undefined);
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: '复制容量交接' }));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【车辆数据中台运维容量交接】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('运行版本:platform-ops-test'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('Kafka Lag:42'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('NATS桥接:consumer pending 1,482,047 / ack pending 4,000'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('存储状态:TDengine 正常 / MySQL 异常'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. 先看 Kafka Lag 与 NATS ACK pending'));
|
||||
});
|
||||
|
||||
test('copies notification text from quality priority queue', async () => {
|
||||
|
||||
Reference in New Issue
Block a user