32 lines
838 B
JavaScript
32 lines
838 B
JavaScript
const app = require('vn-loopback/server/server');
|
|
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
|
|
|
describe('zone zone_getEvents()', () => {
|
|
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);
|
|
|
|
let zonesEvents = result[1];
|
|
|
|
expect(zonesEvents.length).toBeGreaterThan(0);
|
|
});
|
|
});
|