Fix jwt-token
This commit is contained in:
@@ -594,10 +594,17 @@ describe('Models', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should validate battery level range', async () => {
|
it('should validate battery level range', async () => {
|
||||||
|
const tenant = await createTestTenant();
|
||||||
|
const device = await models.Device.create({
|
||||||
|
id: 123,
|
||||||
|
name: 'Test Device',
|
||||||
|
tenant_id: tenant.id
|
||||||
|
});
|
||||||
|
|
||||||
// SQLite doesn't enforce range validation, so test valid creation
|
// SQLite doesn't enforce range validation, so test valid creation
|
||||||
const heartbeat = await models.Heartbeat.create({
|
const heartbeat = await models.Heartbeat.create({
|
||||||
device_key: 'device_123_key',
|
device_key: 'device_123_key',
|
||||||
device_id: 123,
|
device_id: device.id,
|
||||||
battery_level: 85 // Valid range
|
battery_level: 85 // Valid range
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user