salix/modules/worker/back/methods/device/specs/handle-user.spec.js

17 lines
508 B
JavaScript
Raw Normal View History

2024-06-17 11:56:58 +00:00
const {models} = require('vn-loopback/server/server');
2024-09-03 14:50:55 +00:00
describe('Device handleUser()', () => {
2024-07-16 15:20:35 +00:00
const ctx = {req: {accessToken: {userId: 9}}};
2024-06-17 11:56:58 +00:00
2024-09-13 05:10:47 +00:00
it('should return data from user', async() => {
2024-06-17 14:53:06 +00:00
const androidId = 'androidid11234567890';
2024-07-16 15:20:35 +00:00
const deviceId = 1;
2024-06-17 14:53:06 +00:00
const nameApp = 'warehouse';
const versionApp = '10';
2024-06-17 11:56:58 +00:00
2024-09-03 14:50:55 +00:00
const data = await models.Device.handleUser(ctx, androidId, deviceId, versionApp, nameApp);
2024-07-16 15:20:35 +00:00
expect(data.numberOfWagons).toBe(2);
2024-06-17 11:56:58 +00:00
});
});