mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 15:09:10 +00:00
refactor: create mock data utilities
This commit is contained in:
committed by
Carlos Valente
parent
082fe8b8d7
commit
7baa6a4ab9
@@ -1,20 +1,8 @@
|
||||
import { OntimeBlock, OntimeDelay, OntimeEvent, OntimeRundown, SupportedEvent } from 'ontime-types';
|
||||
import { apply } from '../delayUtils.js';
|
||||
import { OntimeBlock, OntimeEvent, OntimeRundown, SupportedEvent } from 'ontime-types';
|
||||
import { MILLIS_PER_HOUR } from 'ontime-utils';
|
||||
|
||||
/**
|
||||
* Small utility to fill in the necessary data for the test
|
||||
*/
|
||||
function makeOntimeEvent(event: Partial<OntimeEvent>): OntimeEvent {
|
||||
return { ...event, type: SupportedEvent.Event, revision: 1 } as OntimeEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Small utility to make a delay event
|
||||
*/
|
||||
function makeOntimeDelay(duration: number): OntimeDelay {
|
||||
return { id: 'delay', type: SupportedEvent.Delay, duration } as OntimeDelay;
|
||||
}
|
||||
import { apply } from '../delayUtils.js';
|
||||
import { makeOntimeDelay, makeOntimeEvent } from '../__mocks__/rundown.mocks.js';
|
||||
|
||||
describe('apply()', () => {
|
||||
it('applies a positive delay to the rundown', () => {
|
||||
|
||||
Reference in New Issue
Block a user