appsok/test/widget_test.dart
toki 74d1f40465 feat(artifact-flow): Jenkins job 선택 흐름을 추가한다
사용자가 Jenkins job 목록을 먼저 확인하고 선택한 뒤 build 목록 단계로 진입할 수 있도록 기본 조회 UI와 클라이언트 모델을 추가한다.
2026-06-09 18:14:09 +09:00

79 lines
2.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:appsok/src/app.dart';
import 'package:appsok/src/theme/app_theme.dart';
void main() {
test('keeps the AppSok work app theme baseline', () {
final theme = AppTheme.light();
final colorScheme = theme.colorScheme;
expect(theme.useMaterial3, isTrue);
expect(colorScheme.primary, const Color(0xFF0B6E69));
expect(colorScheme.secondary, const Color(0xFFD66B3D));
expect(colorScheme.tertiary, const Color(0xFF6655A8));
expect(theme.scaffoldBackgroundColor, const Color(0xFFFAFBF7));
});
testWidgets('renders the app shell', (WidgetTester tester) async {
await tester.pumpWidget(const AppSokApp());
expect(find.text('AppSok'), findsOneWidget);
expect(find.text('빌드'), findsWidgets);
expect(find.text('디바이스'), findsOneWidget);
expect(find.text('콘솔'), findsOneWidget);
expect(find.text('설정'), findsOneWidget);
});
testWidgets('renders shell pages without overflow at compact viewport', (
WidgetTester tester,
) async {
tester.view.physicalSize = const Size(600, 400);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);
await tester.pumpWidget(const AppSokApp());
final navTargets = ['빌드', '디바이스', '콘솔', '설정'];
for (final label in navTargets) {
final navLabel = find.descendant(
of: find.byType(NavigationRail),
matching: find.text(label),
);
await tester.tap(navLabel);
await tester.pumpAndSettle();
expect(tester.takeException(), isNull);
}
});
testWidgets(
'switches between all shell destinations with status placeholders',
(WidgetTester tester) async {
await tester.pumpWidget(const AppSokApp());
final navTargets = <Map<String, String>>[
{'label': '빌드', 'marker': 'Jenkins 연결 필요'},
{'label': '디바이스', 'marker': 'R5CT90A1B2C'},
{'label': '콘솔', 'marker': '패키지 또는 태그'},
{'label': '설정', 'marker': 'Base URL'},
];
for (final target in navTargets) {
final navLabel = find.descendant(
of: find.byType(NavigationRail),
matching: find.text(target['label']!),
);
await tester.tap(navLabel);
await tester.pumpAndSettle();
expect(find.byKey(const ValueKey('status-jenkins')), findsOneWidget);
expect(find.byKey(const ValueKey('status-adb')), findsOneWidget);
expect(find.text('Jenkins 대기'), findsOneWidget);
expect(find.text('ADB 대기'), findsOneWidget);
expect(find.text(target['marker']!), findsOneWidget);
}
},
);
}