fix: harden reminders and state handling
This commit is contained in:
@@ -186,6 +186,21 @@ describe('checkDueExercises gating', () => {
|
||||
expect(h.updateExercise).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('dailyGoal использует reps snapshot из истории, а не текущие reps упражнения', async () => {
|
||||
h.exercises = [makeExercise({ reps: 25, dailyGoal: 20 })]
|
||||
h.history = [
|
||||
{
|
||||
ts: Date.now(),
|
||||
exerciseId: 'ex1',
|
||||
action: 'done',
|
||||
reps: 10
|
||||
}
|
||||
]
|
||||
const { forceCheck } = await loadScheduler()
|
||||
forceCheck()
|
||||
expect(h.fireReminder).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('adaptive: применяет adjustNextFireAt к кандидату', async () => {
|
||||
h.exercises = [makeExercise({ adaptive: true })]
|
||||
const { forceCheck } = await loadScheduler()
|
||||
|
||||
Reference in New Issue
Block a user