Files
base/apps/web/e2e/flows/vital-signs-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

38 lines
1.3 KiB
TypeScript

// apps/web/e2e/flows/vital-signs-flow.spec.ts
import { test, expect } from '../fixtures/auth.fixture';
import { PatientDetailPage } from '../pages/patient-detail.page';
import { makePatient, makeVitalSigns } 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('API录入体征 → 患者详情查看体征数据列表', async ({ api, authenticatedPage: page }) => {
const patient = await api.createPatient(makePatient());
cleanup.push(() => api.deletePatient(patient.id, patient.version));
const vitalSigns = await api.createVitalSigns(patient.id, makeVitalSigns({
systolic_bp_morning: 130,
heart_rate: 80,
}));
cleanup.push(() => api.deleteVitalSigns(patient.id, vitalSigns.id, vitalSigns.version));
const detailPage = new PatientDetailPage(page);
await detailPage.goto(patient.id);
await detailPage.clickTab('健康数据');
await page.waitForTimeout(800);
await detailPage.clickTab('体征数据');
await page.waitForSelector('.ant-table', { timeout: 10000 });
const rows = await page.locator('.ant-table-tbody tr').count();
expect(rows).toBeGreaterThanOrEqual(1);
});
});