salix/db/tests/vn/zone_getEvents.spec.js

32 lines
838 B
JavaScript
Raw Normal View History

2020-05-26 10:07:52 +00:00
const app = require('vn-loopback/server/server');
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
2020-06-04 07:49:13 +00:00
describe('zone zone_getEvents()', () => {
2020-05-26 10:07:52 +00:00
it(`should return data for a agencyMode with deliveryMethod pickup`, async() => {
let stmts = [];
let stmt;
stmts.push('START TRANSACTION');
let params = {
zoneGeoFk: 1,
agencyModeFk: 1};
stmt = new ParameterizedSQL('CALL zone_getEvents(?, ?)', [
params.zoneGeoFk,
params.agencyModeFk,
]);
stmts.push(stmt);
stmts.push('ROLLBACK');
let sql = ParameterizedSQL.join(stmts, ';');
let result = await app.models.Ticket.rawStmt(sql);
2020-06-02 11:53:54 +00:00
let zonesEvents = result[1];
2020-05-26 10:07:52 +00:00
expect(zonesEvents.length).toBeGreaterThan(0);
});
});