feat: 后台管理页全量重构 + backoffice 共享模块 + 启动脚本优化
## 后台管理页重构 - 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 扩展
This commit is contained in:
60
health_app/test/backoffice_ui_test.dart
Normal file
60
health_app/test/backoffice_ui_test.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:health_app/widgets/backoffice_ui.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('backoffice surface provides the shared patient-style canvas', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(home: BackofficeSurface(child: Text('内容'))),
|
||||
);
|
||||
|
||||
expect(find.text('内容'), findsOneWidget);
|
||||
expect(find.byType(DecoratedBox), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets('empty state shows its message and optional action', (
|
||||
tester,
|
||||
) async {
|
||||
var tapped = false;
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BackofficeEmptyState(
|
||||
icon: Icons.people_outline,
|
||||
title: '暂无患者',
|
||||
description: '患者加入后会显示在这里',
|
||||
actionLabel: '刷新',
|
||||
onAction: () => tapped = true,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text('暂无患者'), findsOneWidget);
|
||||
expect(find.text('患者加入后会显示在这里'), findsOneWidget);
|
||||
await tester.tap(find.text('刷新'));
|
||||
expect(tapped, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('error state exposes a retry action', (tester) async {
|
||||
var retried = false;
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(home: BackofficeErrorState(onRetry: () => retried = true)),
|
||||
);
|
||||
|
||||
expect(find.text('加载失败'), findsOneWidget);
|
||||
await tester.tap(find.text('重新加载'));
|
||||
expect(retried, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('inactive doctor banner explains the registration impact', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(home: BackofficeInactiveDoctorBanner()),
|
||||
);
|
||||
|
||||
expect(find.text('账号已停用'), findsOneWidget);
|
||||
expect(find.textContaining('新患者暂时无法选择您'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user