nomadcode/apps/client/test/widget_test.dart
toki 217c17dfef refactor: rename apps/mobile to apps/client and update project structure
- Rename mobile app directory to client throughout the project
- Restructure client app code into feature-based organization
  - Move code to src/features/workspaces/domain/presentation
  - Move services to src/integrations/ (mattermost, workspace, proto_socket)
  - Add app bootstrap and main entry point
- Add push notification integration (Mattermost push client/host/plugin)
- Add proto socket integration for real-time communication
- Add integration tests for push and socket components
- Archive old milestone: client-integration-standardization.md
- Add new workflow core milestone: roadmap-driven-agent-ops-automation.md
- Update agent-ops rules (project, core, mobile, contracts, workspace-ops)
- Update roadmap files (ROADMAP.md, current.md, phase PHASE.md files)
- Update bin scripts (build, dev, lint, test)
- Add test environments documentation
- Update contracts notes for Flutter Core API
2026-05-25 22:10:43 +09:00

43 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:nomadcode_app/src/app/nomadcode_client_app.dart';
import 'package:nomadcode_app/src/features/workspaces/domain/project_workspace.dart';
import 'package:nomadcode_app/src/features/workspaces/presentation/workspace_home_page.dart';
void main() {
testWidgets('App renders console dashboard title', (
WidgetTester tester,
) async {
await tester.pumpWidget(const NomadCodeClientApp());
expect(find.text('NomadCode Console'), findsOneWidget);
expect(find.text('NomadCode Core'), findsNWidgets(2));
expect(find.text('IOP Bridge'), findsOneWidget);
});
testWidgets('WorkspaceHomePage triggers launcher callback on button tap', (
WidgetTester tester,
) async {
ProjectWorkspace? launchedProject;
await tester.pumpWidget(
MaterialApp(
home: WorkspaceHomePage(
onLaunchCodeServer: (project) async {
launchedProject = project;
return true;
},
),
),
);
final buttonFinder = find.widgetWithText(ElevatedButton, 'Open Workspace');
expect(buttonFinder, findsOneWidget);
await tester.tap(buttonFinder);
await tester.pumpAndSettle();
expect(launchedProject, isNotNull);
expect(launchedProject!.id, equals('nomadcode'));
});
}