oto/packages/flutter/oto_console/test/oto_console_test.dart
toki e90ba93eab refactor(core): 코어 경계를 정리한다
클라이언트 계약과 서버 핸들러 경계를 분리해 변경 범위를 명확히 하고, 장기 테스트 흐름에 맞춰 문서와 경로 정리를 함께 반영한다.
2026-06-08 18:59:55 +09:00

68 lines
1.9 KiB
Dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:oto_console/oto_console.dart';
void main() {
test('exports console contract models without shell dependency', () {
expect(
OtoConsoleSection.values.map((section) => section.name),
containsAllInOrder([
'overview',
'runners',
'pipelines',
'executions',
'artifacts',
'agent',
'settings',
]),
);
final contractFile = File('lib/src/oto_console_contract.dart');
final contractSource =
(contractFile.existsSync()
? contractFile
: File(
'packages/flutter/oto_console/lib/src/oto_console_contract.dart',
))
.readAsStringSync();
expect(contractSource, isNot(contains('oto_console_shell.dart')));
});
testWidgets('renders embeddable OTO console shell', (tester) async {
const config = OtoConsoleConfig(
serverHttpUrl: 'http://localhost:8080',
serverWireUrl: 'ws://localhost:18080/runner',
);
await tester.pumpWidget(
const MaterialApp(
home: OtoConsoleShell(
config: config,
capabilities: OtoCapabilityPack(
capabilities: [
OtoCapability(
name: 'Remote Run',
description: 'Dispatch remote build runs.',
),
],
),
overview: OtoConsoleOverview(
config: config,
statusText: 'Disconnected',
),
),
),
);
expect(find.text('Build Operations Overview'), findsOneWidget);
expect(find.byTooltip('Agent'), findsOneWidget);
await tester.tap(find.byTooltip('Agent'));
await tester.pumpAndSettle();
expect(find.textContaining('OTO agent surface is ready'), findsOneWidget);
expect(find.textContaining('Remote Run'), findsOneWidget);
});
}