trigger doRoll if clock is less than startAt

This commit is contained in:
arc-alex
2023-11-20 17:44:39 +01:00
parent afa62a6e38
commit facce4f096
3 changed files with 27 additions and 2 deletions
@@ -703,4 +703,24 @@ describe('typical scenarios', () => {
expect(updateRoll(timers)).toStrictEqual(expected);
});
it('rolls backwards', () => {
const timers = {
selectedEventId: '1',
current: 11,
_startAt: 10,
_finishAt: 15,
clock: 9,
secondaryTimer: null,
secondaryTarget: null,
};
const expected = {
updatedTimer: timers._finishAt - timers.clock,
updatedSecondaryTimer: null,
doRollLoad: true,
isFinished: false,
};
expect(updateRoll(timers)).toStrictEqual(expected);
});
});