Fix jwt-token
This commit is contained in:
@@ -277,7 +277,10 @@ describe('Integration Tests', () => {
|
||||
const mockIo = {
|
||||
emit: sinon.stub(),
|
||||
emitToDashboard: sinon.stub(),
|
||||
emitToDevice: sinon.stub()
|
||||
emitToDevice: sinon.stub(),
|
||||
to: (room) => ({
|
||||
emit: sinon.stub()
|
||||
})
|
||||
};
|
||||
|
||||
// Simulate drone approach with multiple detections
|
||||
|
||||
@@ -27,7 +27,10 @@ describe('Detectors Routes', () => {
|
||||
req.io = {
|
||||
emit: () => {}, // Mock emit function that does nothing
|
||||
emitToDashboard: () => {},
|
||||
emitToDevice: () => {}
|
||||
emitToDevice: () => {},
|
||||
to: (room) => ({
|
||||
emit: () => {} // Mock room-based emit for tenant isolation
|
||||
})
|
||||
};
|
||||
next();
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user