17 lines
610 B
JavaScript
17 lines
610 B
JavaScript
|
const models = require('vn-loopback/server/server').models;
|
||
|
|
||
|
describe('workerTimeControl getClockIn()', () => {
|
||
|
it('should correctly get the timetable of a worker', async() => {
|
||
|
const response = await models.WorkerTimeControl.getClockIn(1106, {});
|
||
|
|
||
|
expect(response.length).toEqual(4);
|
||
|
const [inHrs, middleOutHrs, middleInHrs, outHrs] = response;
|
||
|
|
||
|
expect(inHrs['0daysAgo']).toEqual('07:00');
|
||
|
expect(middleOutHrs['0daysAgo']).toEqual('10:00');
|
||
|
expect(middleInHrs['0daysAgo']).toEqual('10:20');
|
||
|
expect(outHrs['0daysAgo']).toEqual('14:50');
|
||
|
});
|
||
|
});
|
||
|
|