|
...
|
...
|
@@ -26,7 +26,7 @@ void main() { |
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
previousHrvRawEndTime: null,
|
|
|
|
hasExistingHrv: false,
|
|
|
|
realtimeWindow: const [],
|
|
|
|
record: const HealthRawLocalNotificationRecord(),
|
|
|
|
);
|
|
...
|
...
|
@@ -37,7 +37,7 @@ void main() { |
|
|
|
expect(notifications.single.link, healthRawTodayLink);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('builds hrv notification when previous hrv is at least two hours away',
|
|
|
|
test('builds hrv notification when new hrv is calculated after first run',
|
|
|
|
() {
|
|
|
|
final latestTime = _seconds(DateTime(2026, 1, 1, 10));
|
|
|
|
final notifications = builder.build(
|
|
...
|
...
|
@@ -49,7 +49,7 @@ void main() { |
|
|
|
realtimeStressPoints: const [],
|
|
|
|
dailyStressPoints: const [],
|
|
|
|
),
|
|
|
|
previousHrvRawEndTime: latestTime - Duration.secondsPerHour * 2,
|
|
|
|
hasExistingHrv: true,
|
|
|
|
realtimeWindow: const [],
|
|
|
|
record: const HealthRawLocalNotificationRecord(),
|
|
|
|
);
|
|
...
|
...
|
@@ -59,7 +59,7 @@ void main() { |
|
|
|
expect(notifications.single.link, healthRawHrvChangeLink);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('skips hrv notification when previous hrv is too close', () {
|
|
|
|
test('skips hrv notification on first calculation without existing hrv', () {
|
|
|
|
final latestTime = _seconds(DateTime(2026, 1, 1, 10));
|
|
|
|
final notifications = builder.build(
|
|
|
|
result: HealthRawStressCalculationResult(
|
|
...
|
...
|
@@ -70,7 +70,7 @@ void main() { |
|
|
|
realtimeStressPoints: const [],
|
|
|
|
dailyStressPoints: const [],
|
|
|
|
),
|
|
|
|
previousHrvRawEndTime: latestTime - Duration.secondsPerHour * 2 + 1,
|
|
|
|
hasExistingHrv: false,
|
|
|
|
realtimeWindow: const [],
|
|
|
|
record: const HealthRawLocalNotificationRecord(),
|
|
|
|
);
|
|
...
|
...
|
@@ -87,7 +87,7 @@ void main() { |
|
|
|
realtimeStressPoints: [_realtimePoint(base + 9 * 300, 70)],
|
|
|
|
dailyStressPoints: const [],
|
|
|
|
),
|
|
|
|
previousHrvRawEndTime: null,
|
|
|
|
hasExistingHrv: false,
|
|
|
|
realtimeWindow: [
|
|
|
|
for (var i = 0; i < 10; i++) _realtimePoint(base + i * 300, 70),
|
|
|
|
],
|
|
...
|
...
|
@@ -111,7 +111,7 @@ void main() { |
|
|
|
],
|
|
|
|
dailyStressPoints: const [],
|
|
|
|
),
|
|
|
|
previousHrvRawEndTime: null,
|
|
|
|
hasExistingHrv: false,
|
|
|
|
realtimeWindow: [
|
|
|
|
for (var i = 0; i < 9; i++) _realtimePoint(base + i * 300, 70),
|
|
|
|
_realtimePoint(base + 9 * 300, 70, isSleepLikely: true),
|
...
|
...
|
|