## 后台管理页重构 - admin 端: add_doctor / doctors / home / patients 四页重构 - doctor 端: consultations / dashboard / followup_edit / followups / home / patient_detail / patients / profile / report_detail / reports / settings 十一页重构 - 新增 backoffice 共享模块: backoffice_refresh_providers + backoffice_formatters + backoffice_ui ## 后端 - AdminService 增强(分页/搜索/统计) - doctor_endpoints 微调 - appsettings.Development 调整 - 新增 admin_service_tests ## 前端其他 - 今日健康卡片 taskRow 行高 5->7(每行 44->48px) - 健康仪表盘配色定 #4FACFE 纯色蓝 - admin_drawer / doctor_drawer 微调 - api_client IP 适配 ## 启动脚本 - start-dev.bat: 加后端就绪检测(轮询 openapi 端点, 最多等 30s) ## 清理 - 删除旧品牌图(agent_welcome_abstract / login_background_v1) - 删除 app_status_badge 组件 - 删除旧 HANDOFF 文档, 新增 07-17 版 ## 测试 - 新增 backoffice_formatters / backoffice_refresh / backoffice_ui 三个测试 - app_router_test 扩展
100 lines
2.8 KiB
Dart
100 lines
2.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:health_app/core/app_router.dart';
|
|
import 'package:health_app/core/navigation_provider.dart';
|
|
import 'package:health_app/pages/report/report_pages.dart';
|
|
import 'package:health_app/pages/doctor/doctor_followup_edit_page.dart';
|
|
import 'package:health_app/pages/admin/admin_add_doctor_page.dart';
|
|
|
|
void main() {
|
|
testWidgets(
|
|
'detail routes show an error instead of throwing when id is missing',
|
|
(tester) async {
|
|
await tester.pumpWidget(
|
|
ProviderScope(
|
|
child: Consumer(
|
|
builder: (context, ref, _) {
|
|
return MaterialApp(
|
|
home: buildPage(const RouteInfo('aiAnalysis'), ref),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
|
|
expect(tester.takeException(), isNull);
|
|
expect(find.text('页面参数错误'), findsOneWidget);
|
|
},
|
|
);
|
|
|
|
testWidgets('report upload route opens report manager upload options', (
|
|
tester,
|
|
) async {
|
|
late Widget page;
|
|
await tester.pumpWidget(
|
|
ProviderScope(
|
|
child: Consumer(
|
|
builder: (context, ref, _) {
|
|
page = buildPage(
|
|
const RouteInfo('reports', params: {'openUpload': 'true'}),
|
|
ref,
|
|
);
|
|
return const MaterialApp(home: SizedBox());
|
|
},
|
|
),
|
|
),
|
|
);
|
|
|
|
expect(page, isA<ReportListPage>());
|
|
expect((page as ReportListPage).openUploadOnEnter, isTrue);
|
|
});
|
|
|
|
testWidgets('follow-up editor route supports create mode without an id', (
|
|
tester,
|
|
) async {
|
|
late Widget page;
|
|
await tester.pumpWidget(
|
|
ProviderScope(
|
|
child: Consumer(
|
|
builder: (context, ref, _) {
|
|
page = buildPage(const RouteInfo('doctorFollowUpEdit'), ref);
|
|
return const MaterialApp(home: SizedBox());
|
|
},
|
|
),
|
|
),
|
|
);
|
|
|
|
expect(page, isA<DoctorFollowUpEditPage>());
|
|
expect((page as DoctorFollowUpEditPage).id, isNull);
|
|
});
|
|
|
|
testWidgets('admin doctor form route supports edit mode', (tester) async {
|
|
late Widget page;
|
|
await tester.pumpWidget(
|
|
ProviderScope(
|
|
child: Consumer(
|
|
builder: (context, ref, _) {
|
|
page = buildPage(
|
|
const RouteInfo(
|
|
'adminAddDoctor',
|
|
params: {
|
|
'id': 'doctor-1',
|
|
'phone': '13800138000',
|
|
'name': '王医生',
|
|
},
|
|
),
|
|
ref,
|
|
);
|
|
return const MaterialApp(home: SizedBox());
|
|
},
|
|
),
|
|
),
|
|
);
|
|
|
|
expect(page, isA<AdminAddDoctorPage>());
|
|
expect((page as AdminAddDoctorPage).id, 'doctor-1');
|
|
expect((page as AdminAddDoctorPage).initialName, '王医生');
|
|
});
|
|
}
|