Files
base/apps/web/e2e/flows/alert-flow.spec.ts
iven 59856ac2fc feat: initialize ERP base platform (extracted from HMS)
- Stripped 11 business crates (health, ai, dialysis, plugins)
- Cleaned AppState, AppConfig, main.rs from business coupling
- Reduced migrations from 169 to 53 (base-only)
- Removed health_provider trait from erp-core
- Removed business integration tests
- Removed gateway rate limiting middleware
- Base capabilities: auth, RBAC, JWT, config, workflow, message, plugin, audit, crypto, RLS, multi-tenant

Cargo check: OK
Cargo test: OK
2026-05-31 20:35:57 +08:00

29 lines
999 B
TypeScript

// apps/web/e2e/flows/alert-flow.spec.ts
import { test, expect } from '../fixtures/auth.fixture';
import { makeAlertRule } from '../fixtures/test-data';
test.describe('@flow 告警规则链路', () => {
const cleanup: Array<() => Promise<void>> = [];
test.afterEach(async () => {
for (const fn of cleanup.reverse()) {
await fn().catch(() => {});
}
cleanup.length = 0;
});
test('创建告警规则 → 查看列表 → 查看告警页面', async ({ api, authenticatedPage: page }) => {
const rule = await api.createAlertRule(makeAlertRule());
cleanup.push(() => api.deleteAlertRule(rule.id, rule.version));
await page.goto('/#/health/alert-rules');
await page.waitForSelector('.ant-table', { timeout: 10000 });
const tableText = await page.locator('.ant-table-tbody').textContent();
expect(tableText).toBeTruthy();
await page.goto('/#/health/alerts');
await page.waitForSelector('.ant-table, .ant-empty', { timeout: 10000 });
});
});