fleetmap-reports 1.0.479 → 1.0.480
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.test.js +2 -2
- package/src/speeding-report.js +2 -4
package/package.json
CHANGED
package/src/index.test.js
CHANGED
|
@@ -25,8 +25,8 @@ describe('Test_Reports', function () {
|
|
|
25
25
|
const { device, totalDistance, totalEventTime } = await getSpeedingReport(report, userData)
|
|
26
26
|
assert.equal(device.alerts.length, 11) // Total Alerts
|
|
27
27
|
console.log(device.alerts)
|
|
28
|
-
assert.equal(totalDistance,
|
|
29
|
-
assert.equal(totalEventTime,
|
|
28
|
+
assert.equal(totalDistance, 74.71054403083238) // Total Kms
|
|
29
|
+
assert.equal(totalEventTime, 3009000) // Total Duration
|
|
30
30
|
}, 200000)
|
|
31
31
|
// eslint-disable-next-line no-undef
|
|
32
32
|
it('Speeding with custom speed', async () => {
|
package/src/speeding-report.js
CHANGED
|
@@ -232,10 +232,8 @@ async function findEventsPosition (from, to, devices, events, routes, userData)
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
// the linkId property exists when speed events come from here, in that case the data is already calculated
|
|
238
|
-
if (!d.linkId) {
|
|
235
|
+
if (!userData.roadSpeedLimits) {
|
|
236
|
+
a.position = positions[pIndex]
|
|
239
237
|
calculateEventData(positions, pIndex, a, d, geofence, userData)
|
|
240
238
|
}
|
|
241
239
|
}
|