mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 06:04:05 +00:00
refactor: extract time-to-end
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
export enum TimerType {
|
||||
CountDown = 'count-down',
|
||||
CountUp = 'count-up',
|
||||
TimeToEnd = 'time-to-end',
|
||||
Clock = 'clock',
|
||||
None = 'none',
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ export type OntimeEvent = OntimeBaseEvent & {
|
||||
note: string;
|
||||
endAction: EndAction;
|
||||
timerType: TimerType;
|
||||
isTimeToEnd: boolean;
|
||||
linkStart: MaybeString; // ID of event to link to
|
||||
timeStrategy: TimeStrategy;
|
||||
timeStart: number;
|
||||
|
||||
@@ -18,8 +18,8 @@ describe('validateEndAction()', () => {
|
||||
|
||||
describe('validateTimerType()', () => {
|
||||
it('recognises a string representation of an action', () => {
|
||||
const timerType = validateTimerType('time-to-end');
|
||||
expect(timerType).toBe(TimerType.TimeToEnd);
|
||||
const timerType = validateTimerType('count-up');
|
||||
expect(timerType).toBe(TimerType.CountUp);
|
||||
});
|
||||
it('returns fallback otherwise', () => {
|
||||
const emptyType = validateTimerType('', TimerType.Clock);
|
||||
|
||||
Reference in New Issue
Block a user