2018-09-19 13:05:07 +00:00
|
|
|
import './index.js';
|
|
|
|
|
2018-09-25 06:53:57 +00:00
|
|
|
describe('Agency', () => {
|
2018-09-19 13:05:07 +00:00
|
|
|
describe('Component vnZoneIndex', () => {
|
|
|
|
let $componentController;
|
|
|
|
let controller;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2018-09-25 06:53:57 +00:00
|
|
|
angular.mock.module('agency');
|
2018-09-19 13:05:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
beforeEach(angular.mock.inject(_$componentController_ => {
|
|
|
|
$componentController = _$componentController_;
|
|
|
|
controller = $componentController('vnZoneIndex');
|
|
|
|
}));
|
|
|
|
|
|
|
|
describe('exprBuilder()', () => {
|
|
|
|
it('should return a formated object with the id in case of search', () => {
|
|
|
|
let param = 'search';
|
|
|
|
let value = 1;
|
|
|
|
let result = controller.exprBuilder(param, value);
|
|
|
|
|
|
|
|
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 warehouseFk', () => {
|
|
|
|
let param = 'agencyModeFk';
|
|
|
|
let value = 'My Delivery';
|
|
|
|
let result = controller.exprBuilder(param, value);
|
|
|
|
|
|
|
|
expect(result).toEqual({agencyModeFk: 'My Delivery'});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|