fix(getUpcomingDeliveries) fixtures were broken due to db structure changes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-09-01 12:37:46 +02:00
parent 07929af0cb
commit ec9c061051
3 changed files with 6 additions and 4 deletions

View File

@ -1934,7 +1934,7 @@ INSERT INTO `vn`.`zoneIncluded` (`zoneFk`, `geoFk`, `isIncluded`)
(8, 4, 0), (8, 4, 0),
(8, 5, 0), (8, 5, 0),
(8, 1, 1), (8, 1, 1),
(10, 10, 1); (10, 14, 1);
INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `dated`) INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `dated`)
VALUES VALUES

View File

@ -21,6 +21,8 @@ module.exports = Self => {
const [zones] = await Self.rawSql('CALL vn.zone_upcomingDeliveries()', null, myOptions); const [zones] = await Self.rawSql('CALL vn.zone_upcomingDeliveries()', null, myOptions);
if (!zones.length) return;
const details = []; const details = [];
for (let zone of zones) { for (let zone of zones) {

View File

@ -1,12 +1,12 @@
const app = require('vn-loopback/server/server'); const models = require('vn-loopback/server/server').models;
describe('zone getUpcomingDeliveries()', () => { describe('zone getUpcomingDeliveries()', () => {
it('should check returns data', async() => { it('should check returns data', async() => {
const tx = await app.models.Zone.beginTransaction({}); const tx = await models.Zone.beginTransaction({});
try { try {
const options = {transaction: tx}; const options = {transaction: tx};
let result = await app.models.Zone.getUpcomingDeliveries(options); let result = await models.Zone.getUpcomingDeliveries(options);
const firstResultLines = result[0].lines; const firstResultLines = result[0].lines;
const secondResultLines = result[1].lines; const secondResultLines = result[1].lines;