xworkmate-app/test/features/modules_page_test.dart
Haitao Pan 99c6aa9115 feat: 重构侧边栏导航结构
- 更新 WorkspaceDestination 枚举,添加 skills/nodes/agents/clawHub/aiGateway
- 调整侧边栏顺序:助手→任务→技能→节点→代理 | ClawHub→密钥→AI Gateway
- 新建 SkillsPage 展示已安装技能列表
- ModulesPage 添加 initialTab 参数支持直接跳转
- 修复 ai_gateway_page 和 claw_hub_page 的编译错误
- 更新测试文件适配新的导航结构
2026-03-13 21:19:43 +08:00

33 lines
1.1 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:xworkmate/features/modules/modules_page.dart';
import 'package:xworkmate/models/app_models.dart';
import '../test_support.dart';
void main() {
testWidgets(
'ModulesPage switches connectors tab and routes module actions to settings',
(WidgetTester tester) async {
final controller = await createTestController(tester);
controller.navigateTo(WorkspaceDestination.skills);
await pumpPage(
tester,
child: ModulesPage(controller: controller, onOpenDetail: (_) {}),
);
await tester.tap(find.text('配置').first);
await tester.pumpAndSettle();
expect(controller.destination, WorkspaceDestination.settings);
await tester.tap(find.text('连接器'));
await tester.pumpAndSettle();
expect(find.textContaining('连接 Gateway 后可加载连接器状态'), findsOneWidget);
await tester.tap(find.text('接入模块'));
await tester.pumpAndSettle();
expect(controller.destination, WorkspaceDestination.settings);
},
);
}