feat(train): Home opens on today's figures from the band (ADR 0030, D60)
While the Loop gave figures for today, Home shows them above the week: steps, active time, last night's sleep and Nightly Recharge, as Profile lists a day, tapped opening the day's page. Shown above Home's message too, before a first workout; the week waits for one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
5cfab59bd2
commit
a552b7a0fa
1 changed files with 172 additions and 18 deletions
|
|
@ -13,6 +13,7 @@ import 'package:halkyon_train_flutter/src/app/train_dependencies.dart';
|
|||
import 'package:halkyon_train_flutter/src/core/privacy/train_keys.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/day/data/day_repository.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/day/data/loop_lines.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/day/widget/today_card.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/health/data/health_connect.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/health/data/health_platform.dart';
|
||||
import 'package:halkyon_train_flutter/src/feature/health/data/health_store.dart';
|
||||
|
|
@ -2317,6 +2318,43 @@ void main() {
|
|||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets("Home shows today's figures from the band, even before a "
|
||||
"workout, opening the day's page (D60)", (tester) async {
|
||||
await keepTuesday(tester);
|
||||
await withClock(Clock.fixed(DateTime(2026, 10, 27, 18)), () async {
|
||||
await start(tester, usedBefore: true, days: days);
|
||||
|
||||
final today = find.byType(TodayCard);
|
||||
Finder inToday(String text) =>
|
||||
find.descendant(of: today, matching: find.text(text));
|
||||
expect(inToday('Today'), findsOneWidget);
|
||||
expect(inToday('9876 steps'), findsOneWidget);
|
||||
expect(inToday('1 h 50 min active'), findsOneWidget);
|
||||
expect(inToday('7 h 50 min asleep'), findsOneWidget);
|
||||
expect(inToday('Recharge 4 of 6'), findsOneWidget);
|
||||
expect(find.text('No workouts yet'), findsOneWidget);
|
||||
expect(
|
||||
tester.getBottomLeft(today).dy,
|
||||
lessThanOrEqualTo(tester.getTopLeft(find.text('No workouts yet')).dy),
|
||||
);
|
||||
|
||||
await tester.tap(today);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Heart rate'), findsOneWidget);
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('a day without figures for today shows no Today on Home', (
|
||||
tester,
|
||||
) async {
|
||||
await keepTuesday(tester);
|
||||
await withClock(Clock.fixed(DateTime(2026, 10, 28, 9)), () async {
|
||||
await start(tester, usedBefore: true, days: days);
|
||||
|
||||
expect(find.text('Today'), findsNothing);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
group('plans (ADR 0030, D42)', () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue