test(statistiques): couvre les exclusions de progression
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -1139,6 +1139,22 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
await historyRepository.save(
|
||||||
|
_history(
|
||||||
|
id: 'progression-deleted',
|
||||||
|
startedAt: now.subtract(const Duration(days: 3)),
|
||||||
|
totalActiveMs: 900000,
|
||||||
|
result: _historySetResult(
|
||||||
|
id: 'progression-result-deleted',
|
||||||
|
historyId: 'progression-deleted',
|
||||||
|
sourceExerciseId: 'exercise-1',
|
||||||
|
setIndex: 0,
|
||||||
|
startedAt: now.subtract(const Duration(days: 3)),
|
||||||
|
actualReps: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
await historyRepository.delete('progression-deleted', now);
|
||||||
|
|
||||||
final stats = await progressionStatsRepository.readGlobalStats(
|
final stats = await progressionStatsRepository.readGlobalStats(
|
||||||
ProgressionDateRange(
|
ProgressionDateRange(
|
||||||
@ -1207,6 +1223,21 @@ void main() {
|
|||||||
startedAt: now,
|
startedAt: now,
|
||||||
actualReps: 15,
|
actualReps: 15,
|
||||||
),
|
),
|
||||||
|
_historySetResult(
|
||||||
|
id: 'progression-skipped',
|
||||||
|
historyId: 'progression-options',
|
||||||
|
sourceExerciseId: 'exercise-skipped',
|
||||||
|
setIndex: 3,
|
||||||
|
startedAt: now,
|
||||||
|
status: SetResultStatus.skipped,
|
||||||
|
),
|
||||||
|
_historySetResult(
|
||||||
|
id: 'progression-absent-value',
|
||||||
|
historyId: 'progression-options',
|
||||||
|
sourceExerciseId: 'exercise-absent',
|
||||||
|
setIndex: 4,
|
||||||
|
startedAt: now,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -1237,6 +1268,39 @@ void main() {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
test(
|
||||||
|
'progression series reports completed exercise rows without graphable value',
|
||||||
|
() async {
|
||||||
|
final now = DateTime.utc(2026, 7, 22, 14, 30);
|
||||||
|
await historyRepository.save(
|
||||||
|
_history(
|
||||||
|
id: 'progression-no-graphable',
|
||||||
|
startedAt: now,
|
||||||
|
result: _historySetResult(
|
||||||
|
id: 'progression-no-graphable-result',
|
||||||
|
historyId: 'progression-no-graphable',
|
||||||
|
sourceExerciseId: 'exercise-no-graphable',
|
||||||
|
setIndex: 0,
|
||||||
|
startedAt: now,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final series = await progressionStatsRepository.readExerciseSeries(
|
||||||
|
range: ProgressionDateRange(
|
||||||
|
startedAt: now.subtract(const Duration(days: 1)),
|
||||||
|
endedAt: now,
|
||||||
|
),
|
||||||
|
exerciseKey: 'exercise-no-graphable',
|
||||||
|
measure: ProgressionMeasure.reps,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(series.points, isEmpty);
|
||||||
|
expect(series.hasAnyAllTimeData, isFalse);
|
||||||
|
expect(series.hasAnyCompletedExerciseResult, isTrue);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test(
|
test(
|
||||||
'progression exercise series aggregate each measure by session',
|
'progression exercise series aggregate each measure by session',
|
||||||
() async {
|
() async {
|
||||||
|
|||||||
Reference in New Issue
Block a user