17 lines
508 B
JavaScript
17 lines
508 B
JavaScript
const {models} = require('vn-loopback/server/server');
|
|
|
|
describe('Device handleUser()', () => {
|
|
const ctx = {req: {accessToken: {userId: 9}}};
|
|
|
|
it('should return data from user', async() => {
|
|
const androidId = 'androidid11234567890';
|
|
const deviceId = 1;
|
|
const nameApp = 'warehouse';
|
|
const versionApp = '10';
|
|
|
|
const data = await models.Device.handleUser(ctx, androidId, deviceId, versionApp, nameApp);
|
|
|
|
expect(data.numberOfWagons).toBe(2);
|
|
});
|
|
});
|