salix/modules/agency/front/index/index.spec.js

32 lines
984 B
JavaScript
Raw Normal View History

2018-09-19 13:05:07 +00:00
import './index.js';
2019-04-26 14:10:51 +00:00
describe('Agency Component vnZoneIndex', () => {
let $componentController;
let controller;
beforeEach(ngModule('agency'));
2019-04-26 14:10:51 +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});
});
2019-10-25 11:29:05 +00:00
it('should return a formated object with the agencyModeFk in case of agencyModeFk', () => {
2019-04-26 14:10:51 +00:00
let param = 'agencyModeFk';
let value = 'My Delivery';
let result = controller.exprBuilder(param, value);
expect(result).toEqual({agencyModeFk: 'My Delivery'});
2018-09-19 13:05:07 +00:00
});
});
});