34 lines
1.3 KiB
Dart
34 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:appsok/src/features/console/console_page.dart';
|
|
import 'package:appsok/src/theme/app_theme.dart';
|
|
|
|
void main() {
|
|
testWidgets('colors sample logcat rows by parsed level', (tester) async {
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
theme: AppTheme.light(),
|
|
home: const Scaffold(body: ConsolePage()),
|
|
),
|
|
);
|
|
|
|
const infoLine =
|
|
'06-08 10:41:22.121 1832 2110 I ActivityTaskManager: START u0 com.toki.app/.MainActivity';
|
|
const debugLine =
|
|
'06-08 10:41:22.339 5521 5521 D AppSokInstall: install session committed';
|
|
const warnLine =
|
|
'06-08 10:41:22.921 5521 5540 W NetworkMonitor: vpn route not available, using usb install cache';
|
|
const errorLine =
|
|
'06-08 10:41:23.411 5521 5521 E Sample: placeholder error row for filter styling';
|
|
|
|
expect(_textColor(tester, infoLine), const Color(0xFFBDEFA8));
|
|
expect(_textColor(tester, debugLine), const Color(0xFF8DE1D7));
|
|
expect(_textColor(tester, warnLine), const Color(0xFFFFD28A));
|
|
expect(_textColor(tester, errorLine), const Color(0xFFFFA3A3));
|
|
});
|
|
}
|
|
|
|
Color? _textColor(WidgetTester tester, String text) {
|
|
return tester.widget<Text>(find.text(text)).style?.color;
|
|
}
|