Fix jwt-token

This commit is contained in:
2025-09-15 06:39:25 +02:00
parent 2851a2e9c8
commit 159affb113
3 changed files with 32 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
const { describe, it, beforeEach, afterEach, before, after } = require('mocha');
const { expect } = require('chai');
const sinon = require('sinon');
const { hasPermission, checkPermission, requirePermissions } = require('../../middleware/rbac');
const { hasPermission, checkPermission, requirePermission, requirePermissions } = require('../../middleware/rbac');
const { setupTestEnvironment, teardownTestEnvironment, cleanDatabase, mockRequest, mockResponse, mockNext, createTestUser, createTestTenant } = require('../setup');
describe('RBAC Middleware', () => {

View File

@@ -215,7 +215,11 @@ async function createTestDetection(detectionData = {}) {
async function createTestTenant(tenantData = {}) {
const { Tenant } = models;
// Generate a simple test ID for tenant
const testId = 'tenant-' + Date.now() + '-' + Math.random().toString(36).substr(2, 9);
const defaultTenantData = {
id: testId, // Use explicit test ID
name: 'Test Tenant',
slug: 'test-tenant-' + Date.now(),
domain: 'test.example.com',