From 455d953e9a8a255aa142fe518201840045f7f055 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 26 Sep 2019 14:51:45 +0200 Subject: [PATCH] Tests fixed --- modules/agency/back/models/zone.json | 5 +++++ modules/agency/front/card/index.spec.js | 8 ++++---- modules/agency/front/index/index.spec.js | 8 -------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/agency/back/models/zone.json b/modules/agency/back/models/zone.json index 56beaa326..40812ffd1 100644 --- a/modules/agency/back/models/zone.json +++ b/modules/agency/back/models/zone.json @@ -45,6 +45,11 @@ "type": "belongsTo", "model": "AgencyMode", "foreignKey": "agencyModeFk" + }, + "warehouse": { + "type": "belongsTo", + "model": "Warehouse", + "foreignKey": "warehouseFk" }, "events": { "type": "hasMany", diff --git a/modules/agency/front/card/index.spec.js b/modules/agency/front/card/index.spec.js index 86d3ebaa4..729c3d75b 100644 --- a/modules/agency/front/card/index.spec.js +++ b/modules/agency/front/card/index.spec.js @@ -20,10 +20,10 @@ describe('Agency Component vnZoneCard', () => { describe('getCard()', () => { it(`should make a query and define zone property`, () => { let filter = { - include: [ - {relation: 'warehouse', fields: ['name']}, - {relation: 'agencyMode', fields: ['name']} - ] + include: { + relation: 'agencyMode', + scope: {fields: ['name']} + } }; let json = encodeURIComponent(JSON.stringify(filter)); $httpBackend.expectGET(`/agency/api/Zones/1?filter=${json}`).respond({id: 1}); diff --git a/modules/agency/front/index/index.spec.js b/modules/agency/front/index/index.spec.js index c07245fa0..c4ffb975e 100644 --- a/modules/agency/front/index/index.spec.js +++ b/modules/agency/front/index/index.spec.js @@ -22,14 +22,6 @@ describe('Agency Component vnZoneIndex', () => { expect(result).toEqual({id: 1}); }); - it('should return a formated object with the warehouseFk in case of warehouseFk', () => { - let param = 'warehouseFk'; - let value = 'Silla'; - let result = controller.exprBuilder(param, value); - - expect(result).toEqual({warehouseFk: 'Silla'}); - }); - it('should return a formated object with the warehouseFk in case of agencyModeFk', () => { let param = 'agencyModeFk'; let value = 'My Delivery';