This commit is contained in:
Carlos Jimenez Ruiz 2019-09-26 14:52:54 +02:00
commit f3d2313464
3 changed files with 9 additions and 12 deletions

View File

@ -45,6 +45,11 @@
"type": "belongsTo", "type": "belongsTo",
"model": "AgencyMode", "model": "AgencyMode",
"foreignKey": "agencyModeFk" "foreignKey": "agencyModeFk"
},
"warehouse": {
"type": "belongsTo",
"model": "Warehouse",
"foreignKey": "warehouseFk"
}, },
"events": { "events": {
"type": "hasMany", "type": "hasMany",

View File

@ -20,10 +20,10 @@ describe('Agency Component vnZoneCard', () => {
describe('getCard()', () => { describe('getCard()', () => {
it(`should make a query and define zone property`, () => { it(`should make a query and define zone property`, () => {
let filter = { let filter = {
include: [ include: {
{relation: 'warehouse', fields: ['name']}, relation: 'agencyMode',
{relation: 'agencyMode', fields: ['name']} scope: {fields: ['name']}
] }
}; };
let json = encodeURIComponent(JSON.stringify(filter)); let json = encodeURIComponent(JSON.stringify(filter));
$httpBackend.expectGET(`/agency/api/Zones/1?filter=${json}`).respond({id: 1}); $httpBackend.expectGET(`/agency/api/Zones/1?filter=${json}`).respond({id: 1});

View File

@ -22,14 +22,6 @@ describe('Agency Component vnZoneIndex', () => {
expect(result).toEqual({id: 1}); 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', () => { it('should return a formated object with the warehouseFk in case of agencyModeFk', () => {
let param = 'agencyModeFk'; let param = 'agencyModeFk';
let value = 'My Delivery'; let value = 'My Delivery';