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",
"model": "AgencyMode",
"foreignKey": "agencyModeFk"
},
"warehouse": {
"type": "belongsTo",
"model": "Warehouse",
"foreignKey": "warehouseFk"
},
"events": {
"type": "hasMany",

View File

@ -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});

View File

@ -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';