Offline gym log for Android. No account, no ads, no internet.
Dart androidbodybuildingdartexercisesf-droidfitnessfluttergymgym-apphealthprivacyself-hostedworkoutworkout-appworkout-tracker
Update tests for the redesign
InlitX928d7c58a0bf
diff --git a/test/continue_session_test.dart b/test/continue_session_test.dartindex 676de2d..e04bb3b 100644--- a/test/continue_session_test.dart+++ b/test/continue_session_test.dart@@ -91,4 +91,24 @@ void main() {expect(fit.session, isNull);expect(fit.sessions, hasLength(1));});++ test('#264 las fotos del entreno siguen a la sesión aunque se siga entrenando', () async {+ fit.startRoutine(routine(['Barbell Bench Press']));+ fit.endCountdown();+ fit.toggleSet(0, 0);+ fit.finishSession();+ final first = fit.filedSession!;+ fit.moments.add(Moment(first.date, 'a.jpg'));+ fit.moments.add(Moment(first.date.subtract(const Duration(days: 1)), 'b.jpg'));+ expect(fit.momentsOf(first).map((m) => m.file), ['a.jpg']);++ fit.continueSession();+ await Future<void>.delayed(const Duration(milliseconds: 5));+ fit.toggleSet(0, 1);+ fit.finishSession();+ final again = fit.filedSession!;+ expect(again.date.isAtSameMomentAs(first.date), isFalse);+ expect(fit.momentsOf(again).map((m) => m.file), ['a.jpg']);+ expect(fit.moments.firstWhere((m) => m.file == 'b.jpg').date.isBefore(first.date), isTrue);+ });}diff --git a/test/muscle_map_test.dart b/test/muscle_map_test.dartindex 6e51f3c..b0c5839 100644--- a/test/muscle_map_test.dart+++ b/test/muscle_map_test.dart@@ -53,4 +53,18 @@ void main() {fit.sessions.clear();expect(fit.neglectedMuscles(7), isEmpty, reason: 'sin datos no se señala nada');});++ test('#280 la semana cuenta desde el día en que empieza, no los últimos 7', () {+ fit.weekStartDay = DateTime.monday;+ final start = fit.weekStartDate;+ final before = DateTime(start.year, start.month, start.day - 1, 12);+ fit.sessions+ ..add(LoggedSession(before, 1800, [LoggedExercise('x1', 'x1', 'back', [LoggedSet(10, 60)])]))+ ..add(LoggedSession(DateTime(start.year, start.month, start.day, 12), 1800,+ [LoggedExercise('x2', 'x2', 'chest', List.generate(6, (_) => LoggedSet(10, 60)))]));++ expect(fit.muscleSetsThisWeek['back'], isNull);+ expect(fit.muscleSetsThisWeek['chest'], 6);+ expect(fit.muscleHeatThisWeek['chest'], closeTo(0.5, 0.001), reason: 'objetivo semanal entero');+ });}diff --git a/test/shell_transition_test.dart b/test/shell_transition_test.dartindex cacb0f2..a4f4943 100644--- a/test/shell_transition_test.dart+++ b/test/shell_transition_test.dart@@ -103,8 +103,8 @@ void main() {await tester.pumpWidget(const GymManeApp());await tester.pump();- final home = tester.getCenter(find.text(t.home));- final profile = tester.getCenter(find.text(t.profile.toUpperCase()));+ final home = tester.getCenter(find.bySemanticsLabel(t.home));+ final profile = tester.getCenter(find.bySemanticsLabel(t.profile.toUpperCase()));final gesture = await tester.startGesture(home);await tester.pump(const Duration(milliseconds: 700));for (var i = 1; i <= 10; i++) {