salix/modules/zone/back/methods/zone/specs/getZoneClosing.spec.js

23 lines
699 B
JavaScript

const models = require('vn-loopback/server/server').models;
describe('zone getZoneClosing()', () => {
it('should return closing time of zones', async() => {
const tx = await models.Zone.beginTransaction({});
try {
const options = {transaction: tx};
const date = Date.vnNew();
const today = date.toISOString().split('T')[0];
const result = await models.Zone.getZoneClosing([1, 2, 3], today, options);
expect(result.length).toEqual(3);
expect(result[0].hour).toBeDefined();
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});