Fix jwt-token

This commit is contained in:
2025-09-16 07:33:10 +02:00
parent d65862b839
commit dae5d6fc7c
2 changed files with 31 additions and 1 deletions

View File

@@ -271,6 +271,12 @@ describe('Detectors Routes', () => {
describe('POST /detectors - Heartbeat Data', () => {
it('should accept valid heartbeat', async () => {
const device = await createTestDevice({
id: 123,
is_approved: true,
is_active: true
});
const heartbeatData = {
type: 'heartbeat',
key: 'device_123_key',
@@ -304,9 +310,16 @@ describe('Detectors Routes', () => {
});
it('should handle heartbeat with minimal data', async () => {
// For numeric key, route will convert to integer, so create device with numeric ID
const device = await createTestDevice({
id: 123,
is_approved: true,
is_active: true
});
const heartbeatData = {
type: 'heartbeat',
key: 'device_123_key'
key: '123' // Numeric string that will be converted to 123
};
const response = await request(app)
@@ -334,6 +347,12 @@ describe('Detectors Routes', () => {
it('should store heartbeat when debug enabled', async () => {
process.env.STORE_HEARTBEATS = 'true';
const device = await createTestDevice({
id: 123,
is_approved: true,
is_active: true
});
const heartbeatData = {
type: 'heartbeat',
key: 'device_123_key',