feat: send osc

This commit is contained in:
Carlos Valente
2025-01-11 15:24:14 +01:00
committed by Carlos Valente
parent ab4dd300ca
commit 6c4d80158c
7 changed files with 401 additions and 19 deletions
@@ -1,7 +1,7 @@
import { TimerLifeCycle } from 'ontime-types';
import { deleteAllAutomations, addAutomation, addBlueprint } from '../automation.dao.js';
import { triggerAction } from '../automation.service.js';
import { triggerAutomations } from '../automation.service.js';
import { makeOSCAction, makeHTTPAction } from './testUtils.js';
@@ -67,25 +67,25 @@ describe('triggerAction()', () => {
});
it('should trigger automations for a given action', () => {
triggerAction(TimerLifeCycle.onLoad, {});
triggerAutomations(TimerLifeCycle.onLoad, {});
expect(oscSpy).toHaveBeenCalledTimes(1);
expect(httpSpy).not.toBeCalled();
oscSpy.mockReset();
httpSpy.mockReset();
triggerAction(TimerLifeCycle.onStart, {});
triggerAutomations(TimerLifeCycle.onStart, {});
expect(oscClient.emitOSC).not.toBeCalled();
expect(httpSpy).not.toBeCalled();
oscSpy.mockReset();
httpSpy.mockReset();
triggerAction(TimerLifeCycle.onFinish, {});
triggerAutomations(TimerLifeCycle.onFinish, {});
expect(oscSpy).not.toBeCalled();
expect(httpSpy).toHaveBeenCalledTimes(1);
oscSpy.mockReset();
httpSpy.mockReset();
triggerAction(TimerLifeCycle.onStop, {});
triggerAutomations(TimerLifeCycle.onStop, {});
expect(oscSpy).not.toBeCalled();
expect(httpSpy).not.toBeCalled();
});