- 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
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
// apps/web/e2e/flows/follow-up-flow.spec.ts
|
|
import { test, expect } from '../fixtures/auth.fixture';
|
|
import { makePatient, makeFollowUpTemplate, makeFollowUpTask } 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 patient = await api.createPatient(makePatient());
|
|
cleanup.push(() => api.deletePatient(patient.id, patient.version));
|
|
|
|
const template = await api.createFollowUpTemplate(makeFollowUpTemplate());
|
|
cleanup.push(() => api.deleteFollowUpTemplate(template.id, template.version));
|
|
|
|
await page.goto('/#/health/follow-up-tasks');
|
|
await page.waitForSelector('.ant-table', { timeout: 10000 });
|
|
|
|
const task = await api.createFollowUpTask(
|
|
makeFollowUpTask(patient.id, template.id),
|
|
);
|
|
cleanup.push(() => api.deleteFollowUpTask(task.id, task.version));
|
|
|
|
await page.reload();
|
|
await page.waitForSelector('.ant-table');
|
|
|
|
const rowCount = await page.locator('.ant-table-tbody tr').count();
|
|
expect(rowCount).toBeGreaterThanOrEqual(1);
|
|
});
|
|
});
|