24 lines
711 B
Dart
24 lines
711 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/sparkline.dart';
|
|
|
|
void main() {
|
|
testWidgets('paints without error for multiple points, one point, and empty data', (tester) async {
|
|
for (final values in [
|
|
[12.4, 16.0, 4.1, 19.8, 9.2],
|
|
[12.4],
|
|
<double>[],
|
|
]) {
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
theme: AppTheme.light(),
|
|
home: Scaffold(body: Center(child: Sparkline(values: values))),
|
|
),
|
|
);
|
|
expect(tester.takeException(), isNull);
|
|
expect(find.byType(CustomPaint), findsWidgets);
|
|
}
|
|
});
|
|
}
|