- agent-readable-repository-refactor 완료: 기존 테스트 파일 아카이브 이동 - 새 테스트 파일 추가 (edge, node, client, config, readability) - readability_audit 스크립트 및 baseline 추가 - roadmap/SDD 문서 갱신 - agent-client/pi/extensions/openai-sampling-parameters 추가
110 lines
3.5 KiB
Dart
110 lines
3.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:iop_client/client_config.dart';
|
|
import 'package:iop_client/main.dart';
|
|
import 'support/client_test_harness.dart';
|
|
|
|
void main() {
|
|
testWidgets('Client App basic rendering and success handshake test', (
|
|
WidgetTester tester,
|
|
) async {
|
|
final fakeClient = FakeClientWireClient(shouldSuccess: true);
|
|
final fakeStatusRepo = FakeControlPlaneStatusRepository();
|
|
|
|
await tester.pumpWidget(
|
|
IopClientApp(testClient: fakeClient, statusRepository: fakeStatusRepo),
|
|
);
|
|
await tester.pump();
|
|
await tester.pump(const Duration(milliseconds: 100));
|
|
|
|
expect(find.text('IOP CONTROL PLANE'), findsOneWidget);
|
|
expect(find.text('Operations Overview'), findsOneWidget);
|
|
|
|
expect(
|
|
find.text(ClientConfig.controlPlaneHttpUrl, findRichText: true),
|
|
findsOneWidget,
|
|
);
|
|
expect(
|
|
find.text(ClientConfig.controlPlaneWireUrl, findRichText: true),
|
|
findsOneWidget,
|
|
);
|
|
|
|
expect(find.text('CONNECTED'), findsOneWidget);
|
|
});
|
|
|
|
testWidgets('Client App connection error state test', (
|
|
WidgetTester tester,
|
|
) async {
|
|
final fakeClient = FakeClientWireClient(
|
|
shouldSuccess: false,
|
|
mockMessage: 'Invalid Version',
|
|
);
|
|
final fakeStatusRepo = FakeControlPlaneStatusRepository();
|
|
|
|
await tester.pumpWidget(
|
|
IopClientApp(testClient: fakeClient, statusRepository: fakeStatusRepo),
|
|
);
|
|
await tester.pump();
|
|
await tester.pump(const Duration(milliseconds: 100));
|
|
|
|
expect(find.text('ERROR'), findsOneWidget);
|
|
});
|
|
|
|
testWidgets('Client App opens IOP agent panel from the left rail', (
|
|
WidgetTester tester,
|
|
) async {
|
|
final fakeClient = FakeClientWireClient(shouldSuccess: true);
|
|
final fakeStatusRepo = FakeControlPlaneStatusRepository();
|
|
|
|
await tester.pumpWidget(
|
|
IopClientApp(testClient: fakeClient, statusRepository: fakeStatusRepo),
|
|
);
|
|
await tester.pump();
|
|
await tester.pump(const Duration(milliseconds: 100));
|
|
|
|
await tester.tap(find.byTooltip('Agent'));
|
|
await tester.pump();
|
|
|
|
expect(find.text('Ask about IOP operations'), findsOneWidget);
|
|
expect(find.textContaining('IOP agent surface is ready'), findsOneWidget);
|
|
expect(find.textContaining('Edge Control'), findsOneWidget);
|
|
expect(find.textContaining('Node Management'), findsOneWidget);
|
|
});
|
|
|
|
testWidgets(
|
|
'Client App mobile screen layout verification for layout and overflow',
|
|
(WidgetTester tester) async {
|
|
// Set a small mobile screen size
|
|
tester.view.physicalSize = const Size(360, 640);
|
|
tester.view.devicePixelRatio = 1.0;
|
|
|
|
final fakeClient = FakeClientWireClient(shouldSuccess: true);
|
|
final fakeStatusRepo = FakeControlPlaneStatusRepository();
|
|
|
|
await tester.pumpWidget(
|
|
IopClientApp(testClient: fakeClient, statusRepository: fakeStatusRepo),
|
|
);
|
|
await tester.pump();
|
|
await tester.pump(const Duration(milliseconds: 100));
|
|
|
|
// Overview
|
|
expect(find.text('Operations Overview'), findsOneWidget);
|
|
|
|
// Switch to Edges panel
|
|
await tester.tap(find.byTooltip('Edges'));
|
|
await tester.pump();
|
|
expect(find.text('Edge Alpha'), findsNWidgets(2));
|
|
|
|
// Switch to Runtime panel
|
|
await tester.tap(find.byTooltip('Runtime'));
|
|
await tester.pump();
|
|
expect(find.text('Operations & Domain Agents'), findsOneWidget);
|
|
|
|
// Reset view size after test
|
|
addTearDown(() {
|
|
tester.view.resetPhysicalSize();
|
|
tester.view.resetDevicePixelRatio();
|
|
});
|
|
},
|
|
);
|
|
}
|