Fix jwt-token

This commit is contained in:
2025-09-15 14:49:37 +02:00
parent 3b832752d5
commit ecaff2b6ff
3 changed files with 9 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ describe('Integration Tests', () => {
beforeEach(async () => { beforeEach(async () => {
await cleanDatabase(); await cleanDatabase();
alertService.activeAlerts.clear(); alertService.activeAlerts.clear();
trackingService.activeDrones.clear(); trackingService.clear();
}); });
describe('Complete User Registration and Login Flow', () => { describe('Complete User Registration and Login Flow', () => {

View File

@@ -18,7 +18,7 @@ describe('DroneTrackingService', () => {
beforeEach(async () => { beforeEach(async () => {
await cleanDatabase(); await cleanDatabase();
trackingService.activeDrones.clear(); trackingService.clear();
trackingService.removeAllListeners(); trackingService.removeAllListeners();
}); });

View File

@@ -8,6 +8,12 @@ process.env.DB_LOGGING = 'false';
const { Sequelize } = require('sequelize'); const { Sequelize } = require('sequelize');
const path = require('path'); const path = require('path');
const sinon = require('sinon');
// Global Sinon setup - restore all spies after each test
afterEach(() => {
sinon.restore();
});
// Set additional test environment variables // Set additional test environment variables
@@ -121,7 +127,7 @@ async function createTestUser(userData = {}) {
const defaultUserData = { const defaultUserData = {
username: 'testuser', username: 'testuser',
email: 'test@example.com', email: 'test@example.com',
password: 'password123', password_hash: '$2b$10$dummyHashForTestingOnly',
role: 'admin', role: 'admin',
tenant_id: tenant.id, tenant_id: tenant.id,
is_active: true, is_active: true,