30 lines
997 B
Dart
30 lines
997 B
Dart
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!));
|
|
});
|
|
}
|