mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
refactor: rundown service fetches data from data provider (#752)
This commit is contained in:
@@ -48,18 +48,16 @@ describe('mutation on runtimeState', () => {
|
||||
beforeEach(() => {
|
||||
clear();
|
||||
|
||||
vi.mock('../../classes/event-loader/EventLoader.js', () => ({
|
||||
EventLoader: {
|
||||
getPlayableEvents: vi.fn().mockReturnValue([
|
||||
{
|
||||
id: 'mock',
|
||||
cue: 'mock',
|
||||
timeStart: 0,
|
||||
timeEnd: 1000,
|
||||
duration: 1000,
|
||||
},
|
||||
]),
|
||||
},
|
||||
vi.mock('../../services/rundown-service/RundownService.js', () => ({
|
||||
getPlayableEvents: vi.fn().mockReturnValue([
|
||||
{
|
||||
id: 'mock',
|
||||
cue: 'mock',
|
||||
timeStart: 0,
|
||||
timeEnd: 1000,
|
||||
duration: 1000,
|
||||
},
|
||||
]),
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { calculateDuration, dayInMs } from 'ontime-utils';
|
||||
|
||||
import { clock } from '../services/Clock.js';
|
||||
import { RestorePoint } from '../services/RestoreService.js';
|
||||
import { getPlayableEvents } from '../services/rundown-service/RundownService.js';
|
||||
import { getCurrent, getExpectedFinish, getRollTimers, skippedOutOfEvent, updateRoll } from '../services/timerUtils.js';
|
||||
import { EventLoader } from '../classes/event-loader/EventLoader.js';
|
||||
import { timerConfig } from '../config/config.js';
|
||||
|
||||
const initialRuntime: Runtime = {
|
||||
@@ -102,7 +102,7 @@ function patchTimer(newState: Partial<TimerState>) {
|
||||
*/
|
||||
function fetchNumEvents(): number {
|
||||
// TODO: could we avoid having this dependency?
|
||||
return EventLoader.getPlayableEvents().length;
|
||||
return getPlayableEvents().length;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user