Files

30 lines
997 B
Dart
Raw Permalink Normal View History

2026-07-27 14:42:23 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:manager/core/theme/app_theme.dart';
import 'package:manager/core/widgets/mono_text.dart';
void main() {
testWidgets('renders in the JetBrains Mono family, small variant uses a smaller size', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: AppTheme.light(),
home: const Scaffold(
body: Column(
children: [
MonoText('/opt/compose/postgres/docker-compose.yml'),
MonoText('svc_123', small: true),
],
),
),
),
);
final regular = tester.widget<Text>(find.text('/opt/compose/postgres/docker-compose.yml'));
final small = tester.widget<Text>(find.text('svc_123'));
expect(regular.style?.fontFamily, 'JetBrains Mono');
expect(small.style?.fontFamily, 'JetBrains Mono');
expect(small.style!.fontSize!, lessThan(regular.style!.fontSize!));
});
}