fix(test+web): 修复测试编译错误 + 前端构建问题
- 修复透析集成测试 TestApp.dialysis_state() 返回类型不匹配(39个错误) - 修复 erp-core test_helpers SeaORM Database::connect API 变更 - 修复 health_alert/article/data 集成测试函数签名不匹配 - 修复 DailyMonitoringTab 缺失 Input import - 修复 DeviceReadingsTab 未使用接口声明 - 修复 DialysisManageList keyword → search 参数名
This commit is contained in:
@@ -249,7 +249,7 @@ async fn test_alert_list_filter_and_tenant_isolation() {
|
||||
|
||||
// 按患者 A 过滤
|
||||
let (alerts_a, total_a) = alert_service::list_alerts(
|
||||
app.health_state(), app.tenant_id(), Some(patient_a), None, 1, 20,
|
||||
app.health_state(), app.tenant_id(), Some(patient_a), None, None, 1, 20,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
@@ -259,7 +259,7 @@ async fn test_alert_list_filter_and_tenant_isolation() {
|
||||
// 租户隔离
|
||||
let other_tenant = uuid::Uuid::new_v4();
|
||||
let (_alerts_other, total_other) = alert_service::list_alerts(
|
||||
app.health_state(), other_tenant, Some(patient_a), None, 1, 20,
|
||||
app.health_state(), other_tenant, Some(patient_a), None, None, 1, 20,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@@ -236,7 +236,7 @@ async fn test_article_soft_delete() {
|
||||
.expect("删除应成功");
|
||||
|
||||
let result = article_service::get_article(
|
||||
app.health_state(), app.tenant_id(), article.id,
|
||||
app.health_state(), app.tenant_id(), article.id, true,
|
||||
)
|
||||
.await;
|
||||
assert!(result.is_err(), "软删除后查询应失败");
|
||||
@@ -252,7 +252,7 @@ async fn test_article_tenant_isolation() {
|
||||
|
||||
let other_tenant = uuid::Uuid::new_v4();
|
||||
let result = article_service::get_article(
|
||||
app.health_state(), other_tenant, article.id,
|
||||
app.health_state(), other_tenant, article.id, true,
|
||||
)
|
||||
.await;
|
||||
assert!(result.is_err(), "不同租户不应看到此文章");
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
//! 验证体征 CRUD、化验报告 CRUD + 审阅、租户隔离、乐观锁。
|
||||
|
||||
use erp_health::dto::health_data_dto::*;
|
||||
use erp_dialysis::dto::dialysis_dto::ReviewLabReportReq;
|
||||
use erp_health::service::health_data_service;
|
||||
|
||||
use super::test_fixture::TestApp;
|
||||
|
||||
@@ -14,6 +14,7 @@ use super::test_db::TestDb;
|
||||
pub struct TestApp {
|
||||
test_db: TestDb,
|
||||
health_state: HealthState,
|
||||
dialysis_state: DialysisState,
|
||||
tenant_id: uuid::Uuid,
|
||||
operator_id: uuid::Uuid,
|
||||
}
|
||||
@@ -26,9 +27,15 @@ impl TestApp {
|
||||
event_bus: EventBus::new(100),
|
||||
crypto: PiiCrypto::dev_default(),
|
||||
};
|
||||
let dialysis_state = DialysisState {
|
||||
db: test_db.db().clone(),
|
||||
event_bus: health_state.event_bus.clone(),
|
||||
crypto: health_state.crypto.clone(),
|
||||
};
|
||||
Self {
|
||||
test_db,
|
||||
health_state,
|
||||
dialysis_state,
|
||||
tenant_id: uuid::Uuid::new_v4(),
|
||||
operator_id: uuid::Uuid::new_v4(),
|
||||
}
|
||||
@@ -42,12 +49,8 @@ impl TestApp {
|
||||
&self.health_state
|
||||
}
|
||||
|
||||
pub fn dialysis_state(&self) -> DialysisState {
|
||||
DialysisState {
|
||||
db: self.test_db.db().clone(),
|
||||
event_bus: self.health_state.event_bus.clone(),
|
||||
crypto: self.health_state.crypto.clone(),
|
||||
}
|
||||
pub fn dialysis_state(&self) -> &DialysisState {
|
||||
&self.dialysis_state
|
||||
}
|
||||
|
||||
pub fn tenant_id(&self) -> uuid::Uuid {
|
||||
|
||||
Reference in New Issue
Block a user