Commit e9c0024

derdilla <82763757+derdilla@users.noreply.github.com>
2024-11-22 09:38:42
Fix start of warn area not filled at specific angles (#490)
* Fix missing start area at specific angles * update test for horizontal homepage graph
1 parent 6d8dbbc
Changed files (2)
app
lib
features
statistics
test
app/lib/features/statistics/value_graph.dart
@@ -197,7 +197,7 @@ class _ValueGraphPainter extends CustomPainter {
     double maxY,
     double? warnValue,
   ) {
-    if (data.isEmpty) return;
+    if (data.length < 2) return;
 
     Path? path;
     Path? warnPath = warnValue == null ? null : Path();
@@ -228,6 +228,7 @@ class _ValueGraphPainter extends CustomPainter {
 
       warnPath = subPath(warnPath!, progress);
       warnPath.relativeLineTo(0, size.height);
+      warnPath.lineTo(_kLeftLegendWidth, size.height);
 
       final y = _transformY(size, warnValue, minY, maxY);
 
app/test/screens/home_screen_test.dart
@@ -45,8 +45,10 @@ void main() {
     await tester.pumpAndSettle();
 
     expect(find.byType(BloodPressureValueGraph), findsOneWidget);
+    expect(find.byType(SafeArea), findsAtLeast(1));
+    expect(find.byType(Scaffold), findsAtLeast(1));
     expect(find.byType(NavigationActionButtons), findsNothing);
-    expect(find.byType(IntervalPicker), findsNothing);
+    expect(find.byType(IntervalPicker), findsOneWidget);
     expect(find.byType(MeasurementList), findsNothing);
   });