fleetmap-reports 1.0.553 → 1.0.554
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 +0 -29
- package/src/util/utils.js +1 -1
package/package.json
CHANGED
package/src/index.test.js
CHANGED
|
@@ -120,22 +120,6 @@ describe('Test_Reports', function () {
|
|
|
120
120
|
assert.equal(device.trips[1].endPOIName, undefined)
|
|
121
121
|
}, 20000)
|
|
122
122
|
// eslint-disable-next-line no-undef
|
|
123
|
-
it('Trip 2 by device', async () => {
|
|
124
|
-
const report = await getReports()
|
|
125
|
-
const userData = await report.getUserData()
|
|
126
|
-
userData.devices = userData.devices.filter(d => d.id === 11437)
|
|
127
|
-
|
|
128
|
-
const data = await report.tripReport(
|
|
129
|
-
new Date(Date.UTC(2022, 2, 4, 0, 0, 0, 0)),
|
|
130
|
-
new Date(Date.UTC(2022, 2, 4, 23, 59, 59, 0)),
|
|
131
|
-
userData)
|
|
132
|
-
|
|
133
|
-
assert.equal(data.length, 1)
|
|
134
|
-
const device = data[0].devices.find(d => d.device.id === 11437)
|
|
135
|
-
assert.equal(device.trips.length, 5) // Total Trips
|
|
136
|
-
assert.equal(device.totalDistance, 207353.2299999997) // Total Kms
|
|
137
|
-
}, 20000)
|
|
138
|
-
// eslint-disable-next-line no-undef
|
|
139
123
|
it('Trip by device with time period ', async () => {
|
|
140
124
|
const report = await getReports()
|
|
141
125
|
const userData = await report.getUserData()
|
|
@@ -297,19 +281,6 @@ describe('Test_Reports', function () {
|
|
|
297
281
|
assert.equal(device.summary[0].endTime, '2022-01-31T17:36:27.000+0000')
|
|
298
282
|
}, 80000)
|
|
299
283
|
// eslint-disable-next-line no-undef
|
|
300
|
-
it('Activity 2 by device', async () => {
|
|
301
|
-
const report = await getReports()
|
|
302
|
-
const userData = await report.getUserData()
|
|
303
|
-
userData.devices = userData.devices.filter(d => d.id === 11437)
|
|
304
|
-
const data = await report.activityReport(new Date(Date.UTC(2022, 2, 5, 0, 0, 0, 0)),
|
|
305
|
-
new Date(Date.UTC(2022, 2, 5, 23, 59, 59, 0)),
|
|
306
|
-
userData)
|
|
307
|
-
assert.equal(data.length, 1)
|
|
308
|
-
const device = data[0].devices.find(d => d.device.id === 11437)
|
|
309
|
-
assert.equal(device.summary[0].endTime, '2022-03-05T23:59:55.000+0000')
|
|
310
|
-
assert.equal(device.summary[0].distance, 232925.12000000034)
|
|
311
|
-
}, 40000)
|
|
312
|
-
// eslint-disable-next-line no-undef
|
|
313
284
|
it('Activity byDevice groupByDay', async () => {
|
|
314
285
|
const report = await getReports()
|
|
315
286
|
const userData = await report.getUserData()
|
package/src/util/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ const distance = require('@turf/distance')
|
|
|
7
7
|
exports.getTranslations = (userData) => {
|
|
8
8
|
const lang = this.getLanguage(userData)
|
|
9
9
|
if (!messages[lang]) {
|
|
10
|
-
console.warn('no lang found for', userData.user, userData.user.attributes.lang
|
|
10
|
+
console.warn('no lang found for', userData.user, userData.user.attributes.lang)
|
|
11
11
|
}
|
|
12
12
|
return messages[lang] ? messages[lang] : messages['en-GB']
|
|
13
13
|
}
|