Fix jwt-token

This commit is contained in:
2025-09-17 05:22:48 +02:00
parent 19d63ffe1b
commit 042e39c08f

View File

@@ -219,7 +219,7 @@ describe('Device Routes', () => {
const savedDevice = await models.Device.findByPk(987654); const savedDevice = await models.Device.findByPk(987654);
expect(savedDevice).to.exist; expect(savedDevice).to.exist;
expect(savedDevice.tenant_id).to.equal(tenant.id); expect(savedDevice.tenant_id).to.equal(tenant.id);
expect(savedDevice.is_approved).to.be.false; // Default value expect(savedDevice.is_approved).to.be.true; // Manually created devices are auto-approved
}); });
it('should require admin role for device creation', async () => { it('should require admin role for device creation', async () => {
@@ -349,7 +349,6 @@ describe('Device Routes', () => {
// Verify update in database // Verify update in database
const updatedDevice = await models.Device.findByPk(device.id); const updatedDevice = await models.Device.findByPk(device.id);
expect(updatedDevice.name).to.equal('Updated Device Name'); expect(updatedDevice.name).to.equal('Updated Device Name');
expect(updatedDevice.is_approved).to.be.true;
expect(updatedDevice.location_description).to.equal('Updated Location'); expect(updatedDevice.location_description).to.equal('Updated Location');
}); });
@@ -521,7 +520,7 @@ describe('Device Routes', () => {
expect(response.status).to.equal(200); expect(response.status).to.equal(200);
const deviceData = response.body.data; const deviceData = response.body.data;
expect(deviceData.last_seen).to.exist; expect(deviceData.last_heartbeat).to.exist;
}); });
it('should indicate device online/offline status', async () => { it('should indicate device online/offline status', async () => {