diff --git a/backend/tests/helpers/event-controller.ts b/backend/tests/helpers/event-controller.ts index 590ded8..e4781f0 100644 --- a/backend/tests/helpers/event-controller.ts +++ b/backend/tests/helpers/event-controller.ts @@ -1,9 +1,9 @@ import { container } from '../../src/config/index.js'; -import { SystemEventType } from '../../src/models/system-event.model.js'; -import { SystemEventService } from '../../src/services/index.js'; +import { DistributedEventType } from '../../src/models'; +import { DistributedEventService } from '../../src/services'; export const eventController = { - systemEventService: undefined as unknown as SystemEventService, + systemEventService: undefined as unknown as DistributedEventService, pausedEvents: new Map>(), isInitialized: false, originalEmit: null as any, @@ -11,7 +11,7 @@ export const eventController = { initialize() { if (this.isInitialized) return; - this.systemEventService = container.get(SystemEventService); + this.systemEventService = container.get(DistributedEventService); this.originalEmit = this.systemEventService['emitter'].emit; this.pausedEvents.clear(); this.isInitialized = true; @@ -22,7 +22,7 @@ export const eventController = { // Check if the event is paused for the room if ( - eventType === SystemEventType.RECORDING_ACTIVE && + eventType === DistributedEventType.RECORDING_ACTIVE && payload?.roomId && this.pausedEvents.has(payload.roomId) ) { diff --git a/backend/tests/integration/api/recordings/race-conditions.test.ts b/backend/tests/integration/api/recordings/race-conditions.test.ts index b172402..a9791a8 100644 --- a/backend/tests/integration/api/recordings/race-conditions.test.ts +++ b/backend/tests/integration/api/recordings/race-conditions.test.ts @@ -68,7 +68,10 @@ describe('Recording API Race Conditions Tests', () => { try { // Attempt to start recording const result = await startRecording(roomData.room.roomId, roomData.moderatorCookie); - expect(eventServiceOffSpy).toHaveBeenCalledWith(DistributedEventType.RECORDING_ACTIVE, expect.any(Function)); + expect(eventServiceOffSpy).toHaveBeenCalledWith( + DistributedEventType.RECORDING_ACTIVE, + expect.any(Function) + ); expect(handleRecordingLockTimeoutSpy).not.toHaveBeenCalledWith( '', // empty recordingId since it never started roomData.room.roomId @@ -121,7 +124,10 @@ describe('Recording API Race Conditions Tests', () => { // Start recording with a short timeout const result = await startRecording(roomData.room.roomId, roomData.moderatorCookie); - expect(eventServiceOffSpy).toHaveBeenCalledWith(DistributedEventType.RECORDING_ACTIVE, expect.any(Function)); + expect(eventServiceOffSpy).toHaveBeenCalledWith( + DistributedEventType.RECORDING_ACTIVE, + expect.any(Function) + ); // Expect the recording to fail due to timeout expect(handleTimeoutSpy).toHaveBeenCalledWith( '', // empty recordingId since it never started