Fix jwt-token

This commit is contained in:
2025-09-17 21:49:48 +02:00
parent 8c2943ac84
commit 0aacbd9a16
3 changed files with 26 additions and 6 deletions

View File

@@ -448,7 +448,10 @@ describe('AlertService', () => {
const mockIo = {
emit: sinon.stub(),
emitToDashboard: sinon.stub(),
emitToDevice: sinon.stub()
emitToDevice: sinon.stub(),
to: (room) => ({
emit: sinon.stub()
})
};
const result = await alertService.processDetectionAlert(detection, mockIo);
@@ -469,7 +472,10 @@ describe('AlertService', () => {
const mockIo = {
emit: sinon.stub(),
emitToDashboard: sinon.stub(),
emitToDevice: sinon.stub()
emitToDevice: sinon.stub(),
to: (room) => ({
emit: sinon.stub()
})
};
await alertService.processDetectionAlert(detection, mockIo);
@@ -500,7 +506,11 @@ describe('AlertService', () => {
rssi: -45
});
const mockIo = { emitToDashboard: sinon.stub(), emitToDevice: sinon.stub() };
const mockIo = {
emitToDashboard: sinon.stub(),
emitToDevice: sinon.stub(),
to: (room) => ({ emit: sinon.stub() })
};
await alertService.processDetectionAlert(detection1, mockIo);
await alertService.processDetectionAlert(detection2, mockIo);
@@ -520,7 +530,11 @@ describe('AlertService', () => {
threatLevel: 'high'
});
const mockIo = { emitToDashboard: sinon.stub(), emitToDevice: sinon.stub() };
const mockIo = {
emitToDashboard: sinon.stub(),
emitToDevice: sinon.stub(),
to: (room) => ({ emit: sinon.stub() })
};
// Simulate clearing old alerts
await alertService.clearExpiredAlerts(mockIo);